Unix Timestamp to Date Converter for Swift
Convert epoch timestamps (seconds & milliseconds) to human UTC/Local dates and produce instant Date(timeIntervalSince1970:) Swift code.
let date = Date(timeIntervalSince1970: 1728734400.0)
// Sat, 12 Oct 2024 12:00:00 GMT// Apple Reference Date (since Jan 1, 2001 00:00:00 UTC)
let appleEpochSec = 750427200.0
let date = Date(timeIntervalSinceReferenceDate: appleEpochSec)Epoch Dates in the Apple Ecosystem
Unix Epoch (1970)
Standard seconds elapsed since midnight UTC on January 1, 1970. Used by REST APIs, JWT tokens, and Unix databases.
Apple Cocoa Epoch (2001)
Apple Core Foundation & Foundation frameworks internally use seconds since midnight UTC on January 1, 2001 via timeIntervalSinceReferenceDate.
Seconds vs Milliseconds
JavaScript APIs and Java servers often pass 13-digit millisecond timestamps. Swift requires division by 1000 before passing into Date(timeIntervalSince1970:).
Build full iPhone apps without touching Xcode
Enjoying this free Timestamp Converter? Thorous turns your natural language prompts into compiled native SwiftUI apps, with real-time iOS simulator streaming and visual on-screen editing.
Native Mac app · macOS 14 Sonoma or later · Apple silicon & Intel