Parse date
Function: Parse date
This function converts a text string that represents a date and/or time into a structured date object that your application can use. You can specify the exact format of the text and how to handle any time information. This is useful when you receive dates as plain text and need to perform date-related operations or display them consistently.
Input
- Date (STRING, Required): The date you want to convert, provided as a piece of text.
- Default Value:
'2026-01-01 12:00:00'
- Default Value:
- Date format (STRING, Optional): The specific pattern that describes how the date text is structured. This helps the system understand your date string correctly.
- Tips for Date Format:
yfor year (e.g.,yyyyfor 2023)Mfor month (e.g.,MMfor 01,MMMfor Jan)dfor day (e.g.,ddfor 31)Hfor hour (24-hour format, e.g.,HHfor 13)hfor hour (12-hour format, e.g.,hhfor 01)mfor minute (e.g.,mmfor 05)sfor second (e.g.,ssfor 30)
- Example:
yyyy-MM-dd HH:mm:sswould match2023-01-31 12:00:00. - Default Value:
'yyyy-MM-dd HH:mm:ss'(If left blank, the system will try to parse common ISO date formats like2023-01-31T12:00:00Z.)
- Tips for Date Format:
- Time handling (SELECT_ONE, Optional): How the time part of the date should be treated if present or missing.
- Options:
- Ignore time (set to 00:00:00): If your date text includes time, it will be ignored, and the resulting date object will have the time set to the very beginning of the day (midnight).
- Ignore time (set to 23:59:59): If your date text includes time, it will be ignored, and the resulting date object will have the time set to the very end of the day.
- Keep time: The time information from your date text will be preserved in the resulting date object.
- Default Value:
'KEEP'
- Options:
Output
- Name (DATE): The name of the variable where the parsed date will be stored. This variable will hold the date as a DATE type, ready for further use in your application.
- Default Value:
'FORMATTED_DATE'
- Default Value:
Execution Flow
Real-Life Examples
Example 1: Parsing a standard date and time
You have a date and time string from a system log and want to convert it into a date object, keeping the exact time.
- Inputs:
- Date:
2024-07-15 14:30:00 - Date format:
yyyy-MM-dd HH:mm:ss - Time handling:
Keep time - Name:
LogEntryDateTime
- Date:
- Result: A new variable named
LogEntryDateTimeis created, holding the date and timeJuly 15, 2024, 2:30 PM.
Example 2: Parsing a date without time, setting to end of day
You receive a list of project deadlines as MM/dd/yyyy and want to ensure all deadlines are considered to be at the very end of the day.
- Inputs:
- Date:
08/20/2024 - Date format:
MM/dd/yyyy - Time handling:
Ignore time \(set to 23:59:59\) - Name:
ProjectDeadline
- Date:
- Result: A new variable named
ProjectDeadlineis created, holding the dateAugust 20, 2024, 11:59:59 PM.
Example 3: Parsing an ISO-formatted date without specifying a custom format
You have a date string in a common ISO format and want to convert it without needing to specify the format pattern.
- Inputs:
- Date:
2025-03-10T09:15:00Z - Date format: (Leave blank)
- Time handling:
Keep time - Name:
EventStartTime
- Date:
- Result: A new variable named
EventStartTimeis created, holding the date and timeMarch 10, 2025, 9:15 AM.