Forrest logo
back to the date tool

date:tldr:fcd8e

date: Convert a given date to the Unix timestamp format.
$ date -d "${2018-09-01 00:00}" +%s --utc
try on your machine

This command is used to convert a specific date and time into Unix timestamp format. Here's a breakdown of the command: - date is the command that displays the date and time. - -d is an option used to specify the input date. - "${2018-09-01 00:00}" is the input date and time. In this case, it represents September 1, 2018, at midnight (00:00). - +%s is an output format option that tells the date command to display the result as a Unix timestamp, which represents the number of seconds since January 1, 1970. - --utc is an option that ensures the conversion is done in UTC (Coordinated Universal Time) timezone. By executing this command, the output will be the Unix timestamp representation of the specified date and time in UTC timezone.

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