How to covert UTC date and time to local date and time
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 12:42 AM
Hi Experts,
How to covert UTC date and time to my local date and time.
UTC date and time - "2023-04-07 06:25:31"
Locat date and time - "07-04-2023 14:25:31"
system time format- HH:mm:ss
System date format- dd-MM-yyyy
System timezone- Australia/West
Any lead would be really appreciated!
Thanks,
NS
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 01:38 AM - edited 04-05-2023 01:39 AM
You can use GlideTime Api to convert the UTC time to local time based on user Time Zone. Use the below given script to convert.
var gdt = new GlideDateTime("2011-08-31 08:00:00");
gs.print(gdt.getLocalDate());
gs.print(gdt.getLocalTime());