<!-- https://learnsql.cpetoday.com/functions/m/date-fromtext -->
# Date.FromText

Language: Power Query M
Category: Date
Syntax: Date.FromText(text as nullable text, optional options as any) as nullable date
Summary: Reads a date from text, using a format and culture you specify.
Returns: The date, or null when the input is null. An error when the text does not match the format.
Level: Intermediate
Related: Date.From, Date.ToText, Number.FromText, DateTime.From, Text.Insert

## What it does
Date.FromText reads a date typed as text. The text "03/04/2026" is March 4 in the US and April 3 in the UK. A bank export read with the wrong order will not fail. It will quietly produce the wrong dates for any day that is 12 or less. Naming the format and the culture removes that doubt, and it is the reason to use this function instead of Date.From for outside data.
## Syntax and arguments
- text: the date as text.
- options (optional): a record with two fields. Format is the layout, such as "MM/dd/yyyy" for month, day, year. Culture is the culture, such as "en-US" or "en-GB". Without options, the ISO form "2026-10-29" reads correctly.
## Example
A US bank sends dates as month, day and year. A UK bank sends dates as day, month and year. The team reads each feed with its own format, so both give the same kind of date.

```powerquery
let
    UsDate = Date.FromText("10/29/2026", [Format = "MM/dd/yyyy", Culture = "en-US"]),
    UkDate = Date.FromText("29/10/2026", [Format = "dd/MM/yyyy", Culture = "en-GB"]),
    IsoDate = Date.FromText("2026-10-29")
in
    {UsDate, UkDate, IsoDate}
```

All three values are October 29, 2026. Each feed is read with the order its bank uses, so the dates agree.
## Example: a second, different use
Read a value date from a payment file that uses day, month and year with a dot separator, such as "29.10.2026", with the format "dd.MM.yyyy" and culture "de-DE".
## Things to watch
- A day and month that are both 12 or less are ambiguous to a person and to a computer. Always name the format.
- A text date that does not match the format raises an error, which is useful. Wrap it in try ... otherwise only when you intend to set those rows aside.
- Two-digit years are read by a rule that can differ from the source. Use four digits in the format.
- Null in gives null out.
## In business terms
Bank, payroll and customs files arrive with dates in local formats. Reading the date with its stated format is how a team avoids a month-end where invoices appear to be posted to the wrong month.
