DateTime.FromText

DateTime.FromText

Creates a datetime from local and universal datetime formats.

function (optional text as nullable any, optional culture as nullable any) as nullable any

Description

Creates a datetime value from a textual representation, text, following ISO 8601 format standard.

Category

DateTime

Examples

Convert "2010-12-31T01:30:25" into a datetime value.

DateTime.FromText("2010-12-31T01:30:25")

datetime(2010, 12, 31, 1, 30, 25)

Convert "2010-12-31T01:30" into a datetime value.

DateTime.FromText("2010-12-31T01:30")

datetime(2010, 12, 31, 1, 30, 0)

Convert "20101231T013025" into a datetime value.

DateTime.FromText("20101231T013025")

datetime(2010, 12, 31, 1, 30, 25)

Convert "20101231T01:30:25" into a datetime value.

DateTime.FromText("20101231T01:30:25")

datetime(2010, 12, 31, 1, 30, 25)

Convert "20101231T01:30:25.121212" into a datetime value.

DateTime.FromText("20101231T01:30:25.121212")

datetime(2010, 12, 31, 1, 30, 25.121212)