Go Timestamp Guide

Go (Golang) code examples for Unix timestamps. Use time.Now().Unix(), time.Parse(), and format dates with Go's reference time layout system.

Built by Michael Lip

Frequently Asked Questions

How do I get the current timestamp in Go?

Use time.Now().Unix() for seconds or time.Now().UnixMilli() for milliseconds. The time package is part of Go's standard library.

How do I convert an epoch to a time in Go?

Use time.Unix(1712000000, 0) to create a time.Time from epoch seconds. The second argument is nanoseconds for sub-second precision.

How does Go's time formatting work?

Go uses a reference time (Mon Jan 2 15:04:05 MST 2006) as the format template. For example, t.Format("2006-01-02 15:04:05") produces a date string. Each number in the reference time is unique.

How do I parse a date string in Go?

Use time.Parse("2006-01-02", "2025-04-02"). The first argument is the layout using Go's reference time, and the second is the string to parse.

Why does Go use '2006-01-02' as the reference time?

Go's reference time is Mon Jan 2 15:04:05 MST 2006, where each component is a unique number: 01 (month), 02 (day), 03/15 (hour), 04 (minute), 05 (second), 06/2006 (year). This avoids ambiguity.

How It Works

This tool runs entirely in your browser using vanilla JavaScript. No data is sent to any server. All conversions and calculations happen locally on your device, ensuring complete privacy.

EpochPilot uses the browser's built-in Intl.DateTimeFormat API and the IANA timezone database provided by your operating system. This means timezone conversions are always accurate, including Daylight Saving Time transitions.

Related Tools

Privacy

Everything runs locally in your browser. No timestamps, dates, or personal data are transmitted to any server. The source code is open on GitHub.

Contact

EpochPilot is built and maintained by Michael Lip. For questions or feedback, email [email protected].

📊 Format data from our Timestamp Format Encyclopedia — 93 formats documented