Forrest logo
back to the date tool

date:tldr:acd92

date: Display the current date in UTC and ISO 8601 format.
$ date -u +%Y-%m-%dT%H:%M:%SZ
try on your machine

The command date -u +%Y-%m-%dT%H:%M:%SZ can be broken down as follows:

date: This is a command in Unix-like operating systems (including Linux) that is used to display or set the current date and time.

-u: This flag is an option for the date command, and it stands for UTC (Coordinated Universal Time). When used, it will display the date and time in UTC instead of the local time zone.

+%Y-%m-%dT%H:%M:%SZ: This is an argument used with the date command, and it specifies the format in which the date and time should be displayed.

  • %Y: Represents the four-digit year.
  • %m: Represents the two-digit month (with leading zero if necessary).
  • %d: Represents the two-digit day of the month (with leading zero if necessary).
  • %H: Represents the two-digit hour of the day in 24-hour format (with leading zero if necessary).
  • %M: Represents the two-digit minute (with leading zero if necessary).
  • %S: Represents the two-digit second (with leading zero if necessary).
  • T: Represents a literal uppercase "T" character, which is often used as a separator in date-time representations.
  • Z: Represents a literal uppercase "Z" character, which signifies the UTC time zone.

When the command is executed, it will display the current date and time in the specified format: YYYY-MM-DDTHH:MM:SSZ (e.g., 2022-01-01T12:34:56Z) in the UTC time zone.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the date tool