Excel date to Unix timestamp
Converts an Excel date/time value to a Unix timestamp (seconds since January 1, 1970 UTC).
Parameters
| Parameter | Description | Example |
|---|---|---|
| DateTime | Excel date | DATE(2024,1,1) |
Unix Timestamp
The result is the number of seconds that have elapsed since midnight UTC on January 1, 1970.
Syntax
=DateTimeToUnixTimestamp(DateTime)Examples
=DateTimeToUnixTimestamp(DATE(2024,1,1))=DateTimeToUnixTimestamp(TODAY())Date from cell
When to Use
- Preparing data for APIs that use Unix time
- Converting dates for database storage
- Time calculations in seconds
When NOT to Use
| Scenario | Use Instead |
|---|---|
| Need Unix to date | UnixTimestampToDateTime() |
Common Issues & FAQ
What timezone is used?
The conversion assumes UTC. Local dates may need adjustment.
Does this include time?
Yes, if you pass a date with time, the timestamp includes hours/minutes/seconds.
Related Formulas
More MarketXLS Date Functions formulas you can use in the same worksheet:
