Description
Converts a datetime value to an Excel serial date number (1900 date system). The integer part is the number of days since 1899-12-30; the fractional part is the time of day. This is the inverse of ExcelSerialToDate. Use it when writing data to a destination — typically a spreadsheet — that stores dates as numeric serial values.Syntax
DateToExcelSerial(datetime_value)
Arguments
- datetime_value - datetime expression to convert.
Examples
DateToExcelSerial(ToDate('2020-01-01T00:00:00Z'))returns43831.0DateToExcelSerial(ToDate('2020-01-01T12:00:00Z'))returns43831.5
Return value datatype
doubleImpact of null value
If datetime_value is null, returns null.Related functions
- ExcelSerialToDate — the inverse conversion.
- ToDate — parse datetime values from strings or Unix milliseconds.