The Unix date command is the quickest way to inspect time from a Linux or macOS terminal. It can print the current epoch seconds, format a date, and convert an epoch value back into a human-readable timestamp. These commands are especially useful in deployment scripts, shell pipelines, cron jobs, incident response, and debugging sessions where opening a separate application would slow you down.
GeoTimeTools collects the most useful Unix timestamp commands in one place. Use date +%s for current seconds, date +%s%3N on GNU/Linux for milliseconds, date -d @TIMESTAMP to convert a value on GNU date, and date -r TIMESTAMP for the BSD date command used by macOS. Enter your own timestamp to update the conversion commands without manually replacing the number in each line.
Linux and macOS share many Unix conventions but their date utilities are not identical. GNU date supports the -d flag, while BSD date uses -r for reading an epoch value. Keeping both commands visible prevents a common copy-and-paste failure when a script moves between a Linux server and a local Mac. The page favors small, labelled code blocks so each command has a clear purpose.
Current seconds and milliseconds
The +%s format prints the number of seconds since the Unix epoch. GNU date can append %3N to print milliseconds, but BSD date does not support the same nanosecond format sequence. For portable scripts, decide whether your target is Linux, macOS, or both before choosing a command.
Converting an existing timestamp
On GNU/Linux, date -d @1700000000 reads the number after the @ as epoch seconds. On macOS, date -r 1700000000 performs the equivalent conversion. Replace the example with your value and include the timezone or format flags you need for a script.
