A shared example for comparison
All examples convert 1711972800 seconds to April 1, 2024 at 12:00:00 UTC. Check the unit supplied by your API before copying an example.
Explore each language
Go: choose Unix or UnixMilli
time.Unix(seconds, nanos) accepts seconds and a nanosecond remainder. time.UnixMilli(ms) expects milliseconds. Call UTC() before formatting to get an explicit UTC representation.
Bash: distinguish Linux from macOS
GNU date accepts -d @timestamp. The BSD version on macOS uses -r timestamp. The subsecond format %N is not portable between these commands.
English version published September 26, 2026.