Skip to main content
Regexflux

Unix Timestamp

beginner

Matches Unix timestamps (seconds or milliseconds since epoch).

timestampunixepochparsing

Pattern

/\b1[0-9]{9}(?:\d{3})?\b/g

Try It

0 of 6 strings matched

Explanation

Matches 10-digit (seconds) or 13-digit (milliseconds) Unix timestamps starting with 1. Covers dates from 2001 to 2286.

Test Strings

Matching

  • 1704067200
  • 1704067200000
  • 1609459200

Non-matching

  • 999999999
  • 20240115
  • abc

Language Compatibility

LanguageSupport
JSFull support
PYTHONFull support
JAVAFull support
PHPFull support
GOLimited support (ASCII-only word boundaries)

Code Snippets

const regex = /\b1[0-9]{9}(?:\d{3})?\b/g;
const text = "your text here";
const matches = text.match(regex);
console.log(matches);

Related Patterns