Forrest logo
back to the date tool

date:tldr:284c4

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

The command "date -u +%Y-%m-%dT%H:%M:%S%Z" is used to display the current date and time in a specific format.

Here's a breakdown of the command:

  • "date" is a command in Unix-like operating systems that outputs the current date and time.
  • "-u" is an option used with the "date" command to display the date and time in UTC (Coordinated Universal Time) rather than the local time of the system.
  • "+%Y-%m-%dT%H:%M:%S%Z" is the format specifier used to define the desired output format. It consists of a combination of characters and placeholders that will be replaced with the corresponding date and time values.

The format specifier components are as follows:

  • "%Y" represents the four-digit year.
  • "%m" represents the two-digit month (01 to 12).
  • "%d" represents the two-digit day of the month (01 to 31).
  • "T" is a separator character, indicating the start of the time section.
  • "%H" represents the two-digit hour in 24-hour format (00 to 23).
  • "%M" represents the two-digit minute (00 to 59).
  • "%S" represents the two-digit second (00 to 59).
  • "%Z" represents the time zone abbreviation (e.g., UTC, EST, PST).

When you execute this command, it will display the current date and time in the specified format. For example, the output might look like "2022-04-15T10:30:45UTC" if the current date and time are April 15, 2022, 10:30:45 AM in Coordinated Universal Time.

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