34. System Context - Time
Contents
Linux provides commands that allow you to view system’s time information, and with these commands, you can quickly get the time related information.
System Time
We can use the date command to get or set the time of the system:
|
|
Timezone
We can use the TZ variable to specify the time zone where our server is located:
|
|
Time in Difference Timezone
Shows the time in Shanghai when a Auckland clock shows 8:07 on March 07, 2019:
|
|
Hour - 24-hour format
|
|
Hour - 24-hour space padded format
|
|
Hour - 12-hour format
|
|
Hour - 12-hour space padded format
|
|
Minute
|
|
Second
|
|
Nanosecond
|
|
Seconds Since Epoch (Timestamp)
|
|
Time - 24-hour format (Hour:Minute:Second)
|
|
Time - 24-hour format (Hour:Minute)
|
|
Locale Time - 24-hour Clock Time
|
|
Locale Time - 12-hour Clock Time
|
|
AM or PM - Uppercase
|
|
AM or PM - Lowercase
|
|
Timezone - Four Digits
|
|
Timezone - Nearest Minute
|
|
Timezone - Nearest Second
|
|
Timezone - Minimum Necessary Precision
|
|
Timezone - Alphabetic Abbreviation
|
|
References 21 System context, 21.1 date: Print or set system date and time, TWiki.org Service: Date and Time Gateway, 29.10 Specifying time zone rules
Author Dong Chen
LastMod Thu Mar 7 2019