How to Convert a Unix Timestamp on Mac

Photo of Simon Simon Guide 4 min read

If you work with APIs, logs, or databases on a Mac, you run into Unix timestamps constantly: 10-digit numbers like 1732000000 that mean something to machines and nothing to humans until you convert them.

The good news is that macOS can convert them out of the box, no install required. This guide covers how to do it in the Terminal — both directions, plus milliseconds and UTC — and then a faster option for when you do this many times a day.

What Is a Unix Timestamp?

A Unix timestamp is the number of seconds that have passed since midnight UTC on January 1, 1970 (the “Unix epoch”). So 1732000000 is just “this many seconds after that moment.”

Two things trip people up:

  • Seconds vs. milliseconds. A 10-digit number (1732000000) is in seconds. A 13-digit number (1732000000123) is in milliseconds — common in JavaScript and many APIs. You have to divide milliseconds by 1000 before converting.
  • Time zone. A timestamp has no time zone; it’s an absolute moment. When you convert it, you choose whether to display it in your local time or UTC, and the two will look different.

Convert a Unix Timestamp in Terminal

macOS uses the BSD version of the date command, so the flags differ from Linux. Here’s everything you’ll typically need.

Timestamp → human-readable date (in your local time):

Terminal window
date -r 1732000000

The -r flag tells date to treat the number as a Unix timestamp.

Show it in UTC instead of local time:

Terminal window
date -u -r 1732000000

This is the most common gotcha — date -r prints local time by default, so add -u when you need to match a server or log that records UTC.

Get the current timestamp (handy for testing):

Terminal window
date +%s

Date → timestamp (the reverse direction). On macOS you pass the input format with -f and use -j so it doesn’t try to change your system clock:

Terminal window
date -j -f "%Y-%m-%d %H:%M:%S" "2025-01-01 00:00:00" +%s

Milliseconds (13-digit) timestamps. Divide by 1000 first, then convert:

Terminal window
date -r $((1732000000123 / 1000))

(You lose the sub-second part, which is usually fine for reading a date.)

Custom output format. Append a +"..." format string:

Terminal window
date -r 1732000000 +"%Y-%m-%d %H:%M:%S"

When the Terminal gets tedious

The date command is reliable and completely local, which is great. The friction shows up when you do this repeatedly: you have to remember the non-obvious flags (-r, -j -f, -u), switch to a Terminal window, and run a separate command for the reverse direction or each time zone. For a one-off check that’s fine; for the tenth conversion of the day it adds up.

A Faster Option: DevKnife’s Time Inspector

If you convert timestamps often, a dedicated tool removes the flag-remembering and window-switching. DevKnife’s Time Inspector (added in v1.4.0) does the conversion both ways in one place.

DevKnife Time Inspector converting a Unix timestamp to a human-readable date

Time Inspector converting a Unix timestamp to a human-readable date.

You paste a timestamp and immediately see the date; type a date and you get the timestamp back. It handles both seconds and milliseconds, and you reach it from a system-wide shortcut so you don’t have to leave what you’re doing.

Compare time zones at a glance

The part Terminal makes painful is seeing one moment across several time zones at once. Time Inspector shows your converted timestamp in multiple zones together and lets you add and save zones by city.

DevKnife Time Inspector comparing a timestamp across multiple time zones

Convert between timestamps and dates, compare multiple time zones, and see a 24‑hour timeline at a glance.

Because DevKnife is a native app, the conversion happens entirely on your Mac — a small bonus when you’re pasting values straight from production logs.

Summary

For an occasional conversion, the Terminal is all you need:

  • date -r 1732000000 — timestamp to local date
  • date -u -r 1732000000 — timestamp to UTC
  • date +%s — current timestamp
  • date -j -f "%Y-%m-%d %H:%M:%S" "2025-01-01 00:00:00" +%s — date to timestamp

That covers what most timestamp conversions need on macOS. When you find yourself doing it all day or juggling several time zones, that’s the point where a dedicated tool like DevKnife’s Time Inspector starts to pay off.

Tweet Share

Further Reading

·
Guide

How to Convert CSV to JSON on Mac

Learn how to convert CSV to JSON on macOS, why the conversion is trickier than it looks, and how to do it instantly and locally with DevKnife.

Read More
·
Guide

Nmap GUI for macOS

Discover a modern Nmap GUI for macOS with DevKnife. Scan ports easily using a clean native interface while keeping the power of Nmap under the hood.

Read More
DevKnige logo

Ready to try DevKnife?

Fast, private, and built for macOS.

Made for Apple Silicon · macOS 14 · Just 10 MB