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.
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
Q: What timezone is used? A: The conversion assumes UTC. Local dates may need adjustment.
Q: Does this include time? A: Yes, if you pass a date with time, the timestamp includes hours/minutes/seconds.
