Convert UNIX/JavaScript epoch timestamps to human-readable UTC dates and times.
Convert human-readable dates and times to UNIX/JavaScript epoch timestamps.
Automatically displays the current epoch timestamp upon page load.
Easily copy converted values to clipboard with a single click.
Validates user inputs to ensure accurate conversions and prevent errors.
The UNIX epoch, also known as POSIX time or UNIX time, is a system for describing a point in time. It is the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC) on 1 January 1970, not counting leap seconds. It is widely used in computing and is the standard time representation in many operating systems and file formats. JavaScript, which uses milliseconds since the epoch, is a slight variation of this concept, requiring simple conversion for compatibility with UNIX time.
For Epoch to Date conversion:
1. The input epoch is converted to milliseconds by multiplying by 1000 (if it's in seconds).
2. A new Date object is created using this millisecond value.
3. The toUTCString() method is called on this Date object to get the UTC representation.
For Date to Epoch conversion:
1. A new Date object is created from the input string, with 'Z' appended to treat it as UTC.
2. The getTime() method is called on this Date object to get milliseconds since epoch.
3. The result is divided by 1000 and floored to get the epoch in seconds.