Table of contents
TOC
Collapse the table of content
Expand the table of content

DateTime.From

Owen Duncan|Last Updated: 4/19/2018

About

Returns a datetime value from a value.

DateTime.From(value as any, optional culture as nullable text) as nullable datetime  

Arguments

ArgumentDescription
valueValue to convert.
optional cultureA text value corresponding to the culture values supported on your version of Windows, such as "en-US". If the culture is not specified, the current user culture is used. For a list of culture names, see National Language Support (NLS) API Reference.

Type to convert

TypeDescription
textReturns a datetime value from a text value. For more details, see DateTime.FromText.
dateA datetime with value as the date component and 12:0:00 AM as the time component.
datetimezoneThe local date and time equivalent of value.
timeA datetime with the date equivalent to the OLE Automation Date of 0 as the date component and value as the time component.
numberA datetime equivalent the OLE Automation Date expressed by value.
any other typeAn Expression.Error is thrown.

Remarks

  • If a value is null, DateTime.From returns null.

  • If a value is datetime, the same value is returned.

Examples

DateTime.From(#time(06, 45, 12)) equals #datetime(1899, 12, 30, 06, 45, 12)  
DateTime.From(#date(1975, 4, 4)) equals #datetime(1975, 4, 4, 0, 0, 0)  
© 2018 Microsoft