Unix Timestamp Blog
In-depth guides on timestamps, timezone handling, JWT, database migrations, and production bugs. Written by senior engineers.
Featured
How DST Breaks Your Timestamp Logic (And How to Fix It)
Your production monitoring alert just fired twice in a row at 2:30 AM. Your database has duplicate transaction records. Your cron job that's supposed to run once per day executed twice. Welcome to daylight saving time—the twice-yearly apocalypse that catches even experienced engineers off guard. The...
Python datetime vs time.time(): When to Use Each
You're debugging a production logging system when you spot the culprit: timestamps from different services don't align. One logs naive datetime.now(), another uses time.time(), and the third uses deprecated datetime.utcnow(). Two hours wasted. The root cause? Developers treating Python's time and da...
Seconds vs Milliseconds: The Timestamp Bug That Sends Dates to 1970
You're debugging a production incident at 2 AM. User account creation timestamps show "January 1, 1970" across your admin dashboard, despite the accounts being created moments ago. Your backend API returns Unix timestamps in seconds. Your frontend JavaScript code does new Date(apiTimestamp). The mat...
Complete Guide to Unix Timestamp Precision in 2026
Everything engineers need to know about timestamp precision — seconds vs milliseconds vs microseconds, rounding errors in production, and how language runtimes handle precision loss.
All Articles (15)
Falsehoods Developers Believe About Time (2026 Edition)
Your production system just lost 23 hours of revenue data because someone scheduled a cron job at 2:30 AM on the first Sunday of March—the exact moment the US Eastern timezone jumped from 2:00 AM to 3:00 AM. That job never ran. Six months later, a billing audit discovered 47,000 duplicate charges on...
API Timestamp Validation: Rejecting Stale and Future Requests
Your production API just accepted the same payment request twice—from a capture that occurred 6 minutes ago. The timestamp header was valid, the signature checked out, but an attacker replayed the entire request verbatim. This scenario plays out daily across APIs that validate timestamps without imp...
Cron Job Scheduling with Unix Timestamps: Avoiding Drift and Skew
Your 2 AM batch job ran at 2:47 AM. Your 6 PM analytics didn't process yesterday's data at all. The logs show timestamps in three different timezones. This is cron job drift—and it compounds across distributed systems where one scheduler's clock skew cascades into missed data windows, duplicate proc...
Redis TTL Patterns: Using Unix Timestamps for Cache Expiration
Your production cache just took a 40% hit because Redis keys expired 5 minutes early across 3 nodes—not because of code, but because one server's NTP daemon jumped the clock forward. This is the hidden cost of ignoring clock synchronization when choosing between EXPIRE and EXPIREAT in distributed sy...
Negative Unix Timestamps: Working With Dates Before 1970
Your monitoring dashboard displays an alert for a user account created in 1965. Your API rejects it. Your database won't store it. Your junior engineer asks why, and you realize your entire timestamp pipeline assumes dates after 1970. This is the silent killer in legacy systems: negative Unix timest...
Docker Container Time Sync: Why Your Timestamps Drift in Production
You deploy a Node.js service in Docker, logs show timestamps 3 hours in the past, your Kubernetes cron jobs execute at the wrong time, and build systems report "clock skew detected" errors. The container is running, resource limits are fine, but time itself is broken. This isn't a rare edge case—it'...
The Y2038 Problem: What It Is, What's Still Vulnerable, and How to Fix It
Your production database is silently counting down to a time bomb. While most modern 64-bit systems are protected, a 2026 audit reveals that embedded systems, legacy databases, industrial controllers, and NTP infrastructure remain critically exposed to the Y2038 problem. You're likely running vulner...
PostgreSQL vs MySQL Timestamp Storage: What No One Tells You
Your production database just served a timestamp from 3 PM yesterday to a user in Tokyo, and they saw it as 6 AM today. You check the code—no explicit timezone conversion. You check the database—the value looks correct. The bug lives in the ORM layer, silently converting your timestamps in ways the ...
Session Management with Timestamp Expiration
How to implement JWT expiration, sliding session windows, and token refresh correctly using Unix timestamps.
Caching Strategies for Time-Sensitive Data
TTL-based cache invalidation, timestamp-aware CDN configuration, and avoiding stale data in distributed systems.
GraphQL Subscriptions with Real-Time Timestamps
Transmit, validate, and display timestamps in GraphQL subscriptions.