Convert Unix hexadecimal timestamp to human-readable date
This tool converts your hex timestamp/epoch to a normal date. It will also show the decimal Unix timestamp.
Programming Examples
Learn how to convert Unix hexadecimal timestamps in various programming languages:
// Convert hex timestamp to date
function hexToDate(hexTimestamp) {
// Remove 0x prefix if present
const cleanHex = hexTimestamp.replace(/^0x/i, '');
// Parse hex to decimal
const unixSeconds = parseInt(cleanHex, 16);
// Convert to Date object
return new Date(unixSeconds * 1000);
}
// Convert date to hex timestamp
function dateToHex(date) {
const unixSeconds = Math.floor(date.getTime() / 1000);
return unixSeconds.toString(16).toUpperCase();
}
// Example usage
const hexTimestamp = '69722A8E';
const date = hexToDate(hexTimestamp);
console.log(date);
const now = new Date();
const hexTs = dateToHex(now);
console.log('Hex timestamp:', hexTs);JavaScript parseInt() with base 16 converts hex to decimal. toString(16) converts decimal to hex.
What is a Unix Hex Timestamp?
A Unix hex timestamp is simply a Unix timestamp (seconds since January 1, 1970) represented in hexadecimal (base-16) format. This format is sometimes used in embedded systems, log files, or when timestamps need to be stored in a compact hexadecimal representation. Hex timestamps are the same numeric value as decimal timestamps, just displayed in base-16 notation, making them useful for certain programming contexts and binary data formats.
Conversion:
- Hex to Decimal:
parseInt(hex, 16) - Decimal to Hex:
timestamp.toString(16)
Use cases: Embedded systems, hexadecimal log formats, compact timestamp storage, binary data analysis, and converting hex timestamps found in system logs or memory dumps. This tool is particularly useful for developers working with low-level systems or analyzing hexadecimal data formats.
Frequently Asked Questions
What is a hex timestamp?
A hex timestamp is a Unix timestamp represented in hexadecimal (base-16) format. It's the same timestamp value, just displayed in hex notation instead of decimal. For example, the Unix timestamp 1609459200 in hex is 5FFE8100.
How do I convert a hex timestamp to a date?
Enter your hexadecimal timestamp in the input field (with or without 0x prefix) and click convert. The tool will automatically parse the hex value, convert it to a Unix timestamp, and display the corresponding human-readable date.
What is the difference between big-endian and little-endian?
Big-endian stores the most significant byte first, while little-endian stores the least significant byte first. Most systems use big-endian for hex timestamps, but some embedded systems or binary formats may use little-endian.