Explaining different date formats according to your
1.Date
date -u :Displays the time in Coordinated Universal Time (UTC).
date -d “next Friday”
date -R Outputs the date and time in RFC 2822 format.
output
date -I :Outputs the date in ISO 8601 format
output
date “+%Y-%m-%d %H:%M:%S” customizable formate
%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
date -d “2023-12-31 23:59:59” Display the date and time for a specific date: