How to Format a DateTime to a Specific Format?
Comments
-
Could you tell me how I can convert the DateTime data to a String like below:
[b]1/20/2022[/b] to [b]January 20, 2022[/b]
I tried the "Get Long Date String" step, but that shows Thursday, January 20, 2022. I would like it to show without the day of the week.
-
Hello!
This is something we can build with the Merge Plain Text editor. In my example, our DateTime data will be coming from the Get Current Date step, but this can be applied to any situation where we want to convert dates. Following this, I will be mapping it into a Create Data step so that we can see the difference between the standard and formatted data. Below is my current flow configuration:
[img]https://lh3.googleusercontent.com/KVfr60hXGl6HMP2sPTdVfiZd_yAjjByc0DmFtDvmpKmWqR0RsMFAADYI4zKlAP9xYJ_hUcXydcUmFBc9GqFqAPCOFU6Frc7ajopfJ-solGjkn0kLKxqdv-qEQjGd64muZF8_9SUL[/img]
I have two inputs to our Create Data step, Sample Data Time is an unformatted String output, and Formatted Date Time is our formatted data.[img]https://lh5.googleusercontent.com/Wivrn4qigc7ThZdQS56hSKh0CEFFuBhy1-h6I6Y8_h7kjeW_FjOMfTQOBmlZAz5XjvqRs6Vyk8ZaqBVGVWe7yJDvya-wYTN9CT7z1I36MFPA8hXxJpyA82sukRQ2DOhpHceJLtpK[/img]
As you can see above in the Mapping Editor, our Sample Date Time is taking a direct input from the Get Current Date output. The Formatted Date Time is using the Merge Plain Text option. When this is selected, a window will open, and will allow you to build your own string using the available data in the flow.Since the DateTime datatype has formatting available to it by default, we are able to use these to piece together the exact data we want.
Hope this helps!
-Ethan
Howdy, Stranger!
Categories
- 4.2K All Categories
- 67 General
- 11 Training
- 202 Installation / Setup
- 1.1K Flows
- 106 Rules
- 262 Administration
- 212 Portal
- 490 General Q & A
- 695 Forms
- 333 Reports
- 3 Designer Extensions
- 47 Example Flows
- 52 CSS Examples
- 1 Diagram Tile
- 7 Javascript Controls
- 179 Pages
- 5 Process Mining
- New Features
- 179 Datastructures
- 69 Repository
- 221 Integrations
- 28 Multi-Tenant
- 27 SDK
- 78 Modules
- 56 Settings
- 25 Active Directory
- 12 Version 7
- 35 Version 8
- 83 Lunch And Learn Questions