Current Unix Timestamp SECONDS SINCE JAN 01 1970

Current UTC Time
2025-08-20
Convert Datetime to Unix Timestamp in DAX

How to convert Datetime to Unix timestamp in DAX

🎈 🎈 🎈
+1

    UnixTimestamp = (DateValue - DATE(1970, 1, 1)) * 86400    
        

Output:
395804063
Example only. There may be multiple ways to perform this operation.

Code Explanation

In this DAX formula, DateValue is the date you want to convert to a Unix timestamp. The difference between DateValue and DATE(1970, 1, 1) gives the number of days since the Unix epoch. Multiplying by 86400 converts this difference from days to seconds, which is the Unix timestamp.
For example, if DateValue is '1982-07-18 01:34:23', the result will be 395804063.



Other useful DAX date functions

Function Description Example
DATE() Returns a specific date (year, month, day). DATE(2020, 5, 15) returns 2020-05-15
TODAY() Returns the current date (without the time). TODAY() returns 2024-08-28
NOW() Returns the current date and time. NOW() returns 2024-08-28 12:34:56
YEAR() Returns the year portion of a date. YEAR(DATE(2020, 5, 15)) returns 2020
MONTH() Returns the month portion of a date. MONTH(DATE(2020, 5, 15)) returns 5
DAY() Returns the day of the month portion of a date. DAY(DATE(2020, 5, 15)) returns 15
HOUR() Returns the hour portion of a time value. HOUR(NOW()) returns 12
MINUTE() Returns the minute portion of a time value. MINUTE(NOW()) returns 34
SECOND() Returns the second portion of a time value. SECOND(NOW()) returns 56
DATEVALUE() Converts a date in text format to a date-time value. DATEVALUE("2020-05-15") returns 2020-05-15
TIMEVALUE() Converts a time in text format to a date-time value. TIMEVALUE("12:34:56") returns 12:34:56
EOMONTH() Returns the last day of the month for a given date. EOMONTH(TODAY(), 0) returns the last day of the current month.
EDATE() Returns a date that is a specified number of months before or after a given date. EDATE(TODAY(), -1) returns the date one month before today.
Current Unix Timestamp SECONDS SINCE JAN 01 1970

Current UTC Time
2025-08-20
Ad Banner Placeholder
Ad Banner Placeholder
Ad Banner Placeholder
Ad Banner Placeholder