The Unix Time Converter tool handles bidirectional conversion between Unix timestamps (epoch time) and human-readable date formats. It automatically detects the input format and provides comprehensive output including local time, UTC, ISO 8601, relative time, and both second and millisecond precision timestamps.
Features
Automatic detection of timestamp format (seconds vs milliseconds)
Bidirectional conversion (timestamp to date and date to timestamp)
Multiple output formats: Local, UTC, ISO 8601, relative time
Support for natural language date input
Real-time relative time calculation
Use Cases
API Debugging Decode timestamp fields from API responses to understand when events occurred
Log Analysis Convert epoch timestamps in server logs to human-readable dates
Database Queries Generate Unix timestamps for date range queries in SQL or NoSQL databases
Scheduling Calculate future timestamps for scheduled tasks or expiration times
Unix Timestamp (Seconds)
Standard 10-digit Unix timestamp representing seconds since January 1, 1970 UTC:
Unix Timestamp (Milliseconds)
JavaScript-style 13-digit timestamp with millisecond precision:
ISO Date String
ISO 8601 formatted date string:
Human-Readable Date
Natural language date formats parsed by JavaScript Date constructor:
January 1, 2024
2024-01-01
Jan 1, 2024 12:00 PM
The tool provides comprehensive output with all common date representations:
Local: 12/31/2023, 4:00:00 PM
UTC: Sun, 31 Dec 2023 00:00:00 GMT
ISO: 2024-01-01T00:00:00.000Z
Relative: 3 months ago
Unix Seconds: 1704067200
Unix Milliseconds: 1704067200000
Examples
Timestamp to Date
Date to Timestamp
Milliseconds
Convert a Unix timestamp to human-readable formats. Input: Output: Local: 1/1/2024, 12:00:00 AM
UTC: Mon, 01 Jan 2024 00:00:00 GMT
ISO: 2024-01-01T00:00:00.000Z
Relative: 2 months ago
Unix Seconds: 1704067200
Unix Milliseconds: 1704067200000
Convert a human-readable date to Unix timestamp. Input: Output: Local: 6/15/2024, 2:30:00 PM
UTC: Sat, 15 Jun 2024 14:30:00 GMT
ISO: 2024-06-15T14:30:00.000Z
Relative: in 3 months
Unix Seconds: 1718461800
Unix Milliseconds: 1718461800000
Handle JavaScript-style millisecond timestamps. Input: Output: Local: 1/1/2024, 12:00:00 AM
UTC: Mon, 01 Jan 2024 00:00:00 GMT
ISO: 2024-01-01T00:00:00.000Z
Relative: 2 months ago
Unix Seconds: 1704067200
Unix Milliseconds: 1704067200000
The tool automatically detects whether the input is in seconds (10 digits) or milliseconds (13 digits).
Implementation Details
The converter uses the following logic from the engine:
Auto-detection : Timestamps with more than 10 digits are treated as milliseconds
Relative time : Calculated using Intl.RelativeTimeFormat for internationalized output
Date parsing : Falls back to JavaScript Date constructor for flexible input parsing
Source Reference
Implementation location: lib/tools/engine.ts:355-383
case 'unix-time-converter' : {
const ts = detectTimestamp ( input );
if ( ts === null ) {
const date = new Date ( input );
if ( Number . isNaN ( date . getTime ()))
return { output: 'Invalid timestamp or date input.' };
return {
output: [
`Local: ${ date . toLocaleString () } ` ,
`UTC: ${ date . toUTCString () } ` ,
`ISO: ${ date . toISOString () } ` ,
`Relative: ${ relativeTime ( date . getTime ()) } ` ,
`Unix Seconds: ${ Math . floor ( date . getTime () / 1000 ) } ` ,
`Unix Milliseconds: ${ date . getTime () } ` ,
]. join ( ' \n ' ),
};
}
// ... timestamp conversion logic
}
Common Patterns
Current Timestamp
To get the current Unix timestamp, use JavaScript:
Math . floor ( Date . now () / 1000 ) // seconds
Date . now () // milliseconds
Adding Time Intervals
Calculate future timestamps:
// Add 7 days to current timestamp
const futureTs = Math . floor ( Date . now () / 1000 ) + ( 7 * 24 * 60 * 60 );
Time Zone Handling
Unix timestamps are always in UTC. The “Local” output reflects your browser’s time zone, but the underlying timestamp value is timezone-agnostic.