ParseDate (Formats, Str)
Last updated
Last updated
© Copyright 2023, Astera Software
Name | ParseDate |
Syntax | ParseDate (Unknown formats, String str) |
Purpose | To parse a date based on a specified format. |
Description | Returns a date time value if the value was successfully parsed. Otherwise returns an error. This function successively applies specified formats and returns date time value if date is parsed using any of the specified formats. |
Return Type | DateTime |
Parameters | formats [Astera.Functions.DateFormats] str [System.String] – String to be converted |
Example
We have an Orders dataset with a ShippedDate field.
In this example, we will map this field to the string input of the function transformation object. We will also pass a specific date time format, to match the date format of the ShippedDate field, to the Format1 field in the function transformation object using a Variables object.
Where,
Format1 = dd/MM/yyyy hh:mm:ss tt
In the output window, you can see values from the ShippedDate field have been successfully parsed by the function transformation object, as the provided date time format has been matched.