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.4K All Categories
- 81 General
- 13 Training
- 209 Installation / Setup
- 1.2K Flows
- 110 Rules
- 270 Administration
- 213 Portal
- 497 General Q & A
- 711 Forms
- 346 Reports
- 3 Designer Extensions
- 48 Example Flows
- 58 CSS Examples
- 1 Diagram Tile
- 7 Javascript Controls
- 187 Pages
- 5 Process Mining
- New Features
- 186 Datastructures
- 70 Repository
- 230 Integrations
- 29 Multi-Tenant
- 27 SDK
- 81 Modules
- 59 Settings
- 26 Active Directory
- 12 Version 7
- 35 Version 8
- 143 Lunch And Learn Questions