Linux Date Commands

Explaining different date formats according to your
1.Date

date -u :Displays the time in Coordinated Universal Time (UTC).

04 يون, 2024 UTC 07:32:39 م

date -d “next Friday”

07 يون, 2024 EEST 12:00:00 ص

date -R Outputs the date and time in RFC 2822 format.

output

Tue, 04 Jun 2024 22:37:39 +0300

date -I :Outputs the date in ISO 8601 format

output

2024-06-04

date “+%Y-%m-%d %H:%M:%S” customizable formate

2024-06-04 22:49:23

%Y: Year (4 digits)
%m: Month (2 digits)
%d: Day (2 digits)
%H: Hour (00-23)
%M: Minute (00-59)
%S: Second (00-59)
%A: Full weekday name (e.g., Monday)
%a: Abbreviated weekday name (e.g., Mon)
%B: Full month name (e.g., January)
%b: Abbreviated month name (e.g., Jan)

date -s or –set: date -s “2023-12-31 23:59:59”
Sets the system date and time.

date –rfc-3339=seconds

2024-06-04 23:10:08+03:00

date -d “2023-12-31 23:59:59” Display the date and time for a specific date:

31 ديس, 2023 EET 11:59:59 م
Please follow and like us:
Pin Share