Date.FromText

Date.FromText

Creates a Date from local and universal Date formats.

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

Description

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

Category

Date

Examples

Convert "December 31, 2010" into a date value.

Date.FromText("2010-12-31")

date(2010, 12, 31)

Convert "December 31, 2010" into a date value, with a different format

Date.FromText("2010, 12, 31")

date(2010, 12, 31)

Convert "December, 2010" into a date value.

Date.FromText("2010, 12")

date(2010, 12, 1)

Convert "2010" into a date value.

Date.FromText("2010")

date(2010, 1, 1)