Date.FromText

Syntax

Date.FromText(text as nullable text, optional culture as nullable text) as nullable date 

About

Creates a date value from a textual representation, text, following ISO 8601 format standard. An optional culture may also be provided (for example, "en-US").

  • Date.FromText("2010-02-19") // Date, yyyy-MM-dd

Example 1

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

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

#date(2010, 12, 31)

Example 2

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

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

#date(2010, 12, 31)

Example 3

Convert "December, 2010" into a date value.

Date.FromText("2010, 12")

#date(2010, 12, 1)

Example 4

Convert "2010" into a date value.

Date.FromText("2010")

#date(2010, 1, 1)