Skip to main content
AllDevToolsHub
Back to all patterns

Unix Timestamp (Milliseconds)

Dates & Numbers

Matches a 13-digit Unix timestamp in milliseconds.

/^1[0-9]{12}$/

How it works

JavaScript's Date.now() returns milliseconds; many APIs (notably Stripe, GCP) use seconds. Mixing the two is a frequent bug. This regex checks for the 13-digit ms form.

Test Cases

Should Match

  • 1716552896123
  • 1000000000000

Should NOT Match

  • 1716552896
  • 171655289612345

Quick Summary

Matches a 13-digit Unix timestamp in milliseconds.