📅Date & Time

Unix Timestamp (Epoch)

The number of seconds that have elapsed since January 1, 1970 (UTC).

Explanation

Unix timestamps are widely used in computing because they are simple integers and independent of timezones.

Examples

Current Seconds
Output
1705069800
In Milliseconds
Output
1705069800000

Code Examples

JavaScript
// Seconds
const seconds = Math.floor(Date.now() / 1000);
// Milliseconds
const ms = Date.now();
Python
import time
# Seconds
seconds = int(time.time())

💡 Tips

  • Unix timestamps are always UTC
  • Use 64-bit integers to avoid the Year 2038 problem
  • Great for simple date arithmetic (adding seconds)

⚠️ Common Pitfalls

  • Watch out for seconds vs. milliseconds
  • Javascript uses milliseconds by default