How to convert the any date time to yyyy-MM-dd "2024-12-30 08:14:54
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2024 12:37 AM - edited 11-13-2024 01:34 AM
How to convert the any date time format into yyyy-MM-dd "2024-12-30 08:14:54" this format. My requirement is that i want the datetime to be in System(yyyy-MM-dd) format.
Thanks,
Shashank Sharma
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2024 01:49 AM
In that case, try to play with the below script and adjust accordingly, you can use the background script to see it for the current date and time:
var gdt = new GlideDateTime();
gs.info(gdt);
Perhaps check the instance time format property
———
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */