Unix Timestamp ↔ Date Converter
A Unix timestamp counts the seconds since 1970-01-01 00:00:00 UTC — the lingua franca of computer clocks, APIs and database fields. Enter a timestamp to instantly see the UTC ISO 8601 string, Hong Kong time (UTC+8), milliseconds, RFC 1123 HTTP date and your browser-local time. The date picker works the other way too.
Enter a valid Unix timestamp (JavaScript Date range is ±100,000,000 days from epoch).
UTC (ISO 8601)
2023-11-14T22:13:20.000Z
Tue
Hong Kong Time (HKT)
2023-11-15T06:13:20.000+08:00
Wed
Milliseconds
1700000000000
—
HTTP date (RFC 1123)
Tue, 14 Nov 2023 22:13:20 GMT
HTTP / RFC 1123
Browser local time
—
Uses this device’s timezone and locale. Servers, APIs and log files normally store the UTC value above.
Formula
milliseconds = seconds × 1000 UTC = new Date(milliseconds) HKT wall-clock = UTC + 8 h (Hong Kong has no daylight saving)
- · Unix time (a.k.a. POSIX time / epoch time) ignores leap seconds — about 27 have accumulated since 1972. System clocks pretend every day is exactly 86,400 seconds.
- · JavaScript Date can represent ±100,000,000 days from 1970 (about ±271,821 years). In seconds that's roughly ±8.64 × 10¹². Anything outside returns null.
- · 10-digit seconds vs 13-digit milliseconds is the classic mix-up. 1,700,000,000 is seconds; 1,700,000,000,000 is milliseconds. Pick the right one in the unit selector.
- · Hong Kong Time (HKT) has been fixed at UTC+08:00 since 1979 — no daylight saving, ever — so the converter simply adds 8 hours to UTC.
- · RFC 1123 HTTP date (e.g. Tue, 14 Nov 2023 22:13:20 GMT) is the standard format for Cookie, Last-Modified and Date response headers.
- · Edge cases worth knowing: 0 = 1970-01-01T00:00:00Z; 2,147,483,647 = 2038-01-19T03:14:07Z — the signed 32-bit overflow point (the "Y2K38" bug).
Frequently asked
I have a 13-digit number that might be a timestamp — seconds or milliseconds?
Almost certainly milliseconds. Unix seconds have been 10 digits since 2001-09-09 (≥ 10⁹) and won't reach 11 digits until 2286. Anything 13 digits long (≥ 10¹²) is milliseconds — switch the unit selector to "milliseconds (ms)". A 10-digit value like 1700000000 is seconds. Nineteen-digit numbers are typically nanoseconds; divide by 1,000,000 first to get milliseconds.
Why do the UTC and HKT dates sometimes fall on different calendar days?
Because HKT = UTC + 8 hours. If the UTC clock reads anywhere from 16:00 onwards, adding 8 hours pushes you past midnight and the HKT date is already the next day. For instance, 2023-11-14 22:13:20 UTC is 2023-11-15 06:13:20 HKT. This is the source of many "off by one day" bugs when an HK user reads logs from a US-region server.
Does the converter handle dates before 1970?
Yes — pre-1970 dates use negative timestamps. For example -1 corresponds to 1969-12-31 23:59:59 UTC, and -86400 to 1969-12-31 00:00:00 UTC. The JavaScript Date object supports anything within ±100,000,000 days of the epoch (about ±271,821 years); values outside this range trigger the validation error. Negative milliseconds work the same way as negative seconds.
What is the "Year 2038" problem — does this converter have it?
The Unix timestamp at 2038-01-19 03:14:07 UTC is 2,147,483,647 = 2³¹ − 1, which is the maximum positive value for a signed 32-bit integer. Systems that store the timestamp in 32 bits will wrap around to a negative value (back to 1901) the next second. This tool uses JavaScript Number (53-bit safe integers), so it isn't affected — it happily handles dates well past 2286, when the seconds value crosses 11 digits. If your backend uses C's `time_t` or pre-2038 MySQL TIMESTAMP columns, plan a migration.
Related tools
Age Calculator
From your date of birth, get exact age, Chinese nominal age (虛歲), days lived and days to next birthday.
Date Difference Calculator
Enter any two dates to get the calendar gap, working days, weekend days, plus year/month/day breakdown and total weeks/months.
Time Zone Converter
Pick your local and target cities to convert a given clock time across time zones.
Date Add / Subtract Calculator
Add or subtract years, months, weeks and days from a start date to get the resulting date and weekday.
Business Days Calculator
Count the working days between two dates (excluding weekends) — or add N business days to a start date to find the deadline.
Pregnancy Due Date Calculator
Estimate the due date from your last menstrual period (LMP) using Naegele's rule, plus current gestational week, trimester and key pregnancy milestones.
Time Card Calculator (clock-in / clock-out / break)
Enter clock-in/clock-out times and break minutes to get total hours worked and gross pay — overnight (graveyard) shifts handled automatically.
Day of Year & Week Number Calculator
Pick any date to see which day of the year (1–366), ISO 8601 week number, weekday, and how many days from the start and end of the year.
Day of the Week Calculator (Any Date)
Enter any Gregorian date (past or future) to instantly find the day of the week — useful for birthdays, anniversaries and historical events.
Easter Date Calculator
Pick a year and the Computus algorithm returns Easter Sunday plus Ash Wednesday, Palm Sunday and Good Friday.
Moon Phase Calculator
Enter any date to compute the lunar phase (new, first quarter, full, last quarter …), moon age in days and illuminated fraction.
Chinese Zodiac & Lunar Age Calculator
Find your Chinese zodiac animal, stem-branch element, zodiac year and lunar (nominal) age from any birth date.
Western Zodiac Sign Calculator
Enter your birth date to see your Western zodiac sign (Aries, Taurus, Gemini…) along with its element, modality and opposing sign.
Birthstone Calculator
Pick a birth month to instantly see the modern and traditional birthstones, the birth flower, the spanning zodiac signs and a colour swatch — handy when choosing jewellery or birthday gifts.
Julian Day Number Calculator
Convert a Gregorian calendar date to its Julian Day Number (JDN) and Modified Julian Day (MJD) — used in astronomy, history, and cross-calendar date math.
ISO 8601 Week Number Calculator
Enter any date and compute its ISO 8601 week number, ISO year and weekday — using the Monday-first / first-week-contains-Jan-4 rule.
Time Between Two Times Calculator
Enter two clock times (HH:MM[:SS]) and instantly see the difference in hours, minutes and seconds — with overnight-shift handling and decimal-hour output.
Hong Kong Statutory Annual Leave Calculator
Enter years of service and see the statutory paid annual leave entitlement under the HK Employment Ordinance §41AA.
Half-Birthday Calculator
Enter your date of birth to see when your next half-birthday falls, how many days away it is, and your current half-age (e.g. 33.5 years).
Daylight Hours (Sunrise / Sunset) Calculator
Enter a latitude, longitude and date to get the local sunrise, sunset, solar noon and total daylight hours using the NOAA solar position formula.