i want to convert the string to date and time format in flow designer transform functions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2025 08:17 AM
For the date alone i had used custom type with this value: yyyyMMdd it worked fine.
Please suggest if any body worked on date and time from the string field
2025-07-22 08:45:00

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2025 09:55 AM
Hi @rajamusani ,
Why don't to just use GlideDateTime() api as below.
var dateString = "2024-07-22 08:30:00"; //sample string
var gdt = new GlideDateTime(dateString);
gs.info(gdt.getDisplayValue()); //date time type output
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 06:44 AM
HI @rajamusani ,
Hope, above solution met your requirement if so,
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 07:29 AM - edited 07-23-2025 07:33 AM
You can use the custom format : yyyy-MM-dd '00:00:00'
or ServiceNow Date/time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2025 11:57 PM
Hi Team,
Now i had changed to to the custom format yyyyMMddHHmmss, I will let you know after some testing results in my sub flow.
Thank you,
Rajasekhar