Forum Discussion
Converting specific text to date in PowerQuery
- 9 years ago
Hi jrduboue,
You can use Date.FromText to achieve this requirement. It returns a Date value from a set of date formats and culture value, following ISO 8601 format standard.
Date.FromText(date as nullable text, optional culture as nullable text) as nullable dateSupported formats
-
yyyy-MM-dd
-
YYYYMMDD
-
M/d/yyyy
Reference
https://msdn.microsoft.com/en-us/library/mt260703.aspxRegards,
Charlie Liao
-
Hi jrduboue,
You can use Date.FromText to achieve this requirement. It returns a Date value from a set of date formats and culture value, following ISO 8601 format standard.
Date.FromText(date as nullable text, optional culture as nullable text) as nullable date
Supported formats
-
yyyy-MM-dd
-
YYYYMMDD
-
M/d/yyyy
Reference
https://msdn.microsoft.com/en-us/library/mt260703.aspx
Regards,
Charlie Liao
not very useful. Our date format may vary such as: yymmdd, yyyymmmdd, ddmmmyy, ddmmyyyy,.... And we would like to get dates from our origin column in a specified format. Is there kind of function like: DateFromString(DateColumn, "yymmdd"). We can easily do this in other languages.