35. System Context - Date
Contents
Linux provides commands that allow you to view system’s date information, and with these commands, you can quickly get the date related information.
System Date
We can use the date command to get or set the date of the system:
|
|

Prints datetime
Locale Datetime
|
|

Prints locale's datetime
Locale Date
|
|

Prints locale's time
Locale Weekday - Abbreviation
|
|

Prints locale's abbreviated weekday name
Locale Weekday - Full Name
|
|

Prints locale's full weekday name
Locale Month - Abbreviation
|
|

Prints locale's abbreviated month name
Locale Month - Full Name
|
|

Prints locale's full month name
Date - YYYY-MM-DD (ISO 8601 format)
|
|

Prints date in YYY-MM-DD format
Date - DD/MM/YY
|
|

Prints date in DD/MM/YY format
Century
|
|

Prints century
Year - YYYY
|
|

Prints year in YYYY format
Year - YY
|
|

Prints year in YY format
Month - MM
|
|

Prints month in MM format
Week of Year - 00 to 53 (First Day Monday)
|
|

Prints Monday first week number
Week of Year - 00 to 53 (First Day Sunday)
|
|

Prints Sunday first week number
ISO Week Number Year - YY
|
|

Prints week number year in YY format
ISO Week Number Year - YYYY
|
|

Prints week number year in YYYY format
Day of Week - Zero to Six
|
|

Prints day of week zero to six
Day of Week - One to Seven
|
|

Prints day of week one to seven
Day of Month
|
|

Prints month
Day of Month - Space Padded
|
|

Prints space padded month
Day of Year
|
|

Prints day of year
Day or Days Ago
|
|

Prints a day ago
|
|

Prints two days ago
Day or Days Hence
|
|

Prints a day hence
|
|

Prints two days hence
Month or Months Ago
|
|

Prints a month ago
|
|

Prints two months ago
Month or Months Hence
|
|

Prints a month hence
|
|

Prints two months hence
Year or Years Ago
|
|

Prints a year ago
|
|

Prints two years ago
Year or Years Hence
|
|

Prints a year hence
|
|

Prints two years hence
References 21 System context, 21.1.2 Date conversion specifiers, 21.1.7 Examples of date
Author Dong Chen
LastMod Fri Mar 8 2019