Select to view content in your preferred language

UTC time Conversion for InfoTemplate popup

383
1
07-19-2022 11:40 AM
AJThomas
Emerging Contributor

Hello All,  Is it possbile to convert a time that is returned by a fetch and looks like: 

2022-07-18T10:45:00-06:00

to a more avg. usable readable format?

I can use:

${idp_filedate:DateFormat}
 
to convert:
 
Tue, 19 Jul 2022 18:34:00 GMT
 
to:
 
7/19/22, 12:34 PM
 
Please let me know, thanks.
~AJ
0 Kudos
1 Reply
KenBuja
MVP Esteemed Contributor

You can convert that to a readable date with this code

var time = '2022-07-18T10:45:00-06:00';
console.log(new Date(time).toLocaleString()); //returns "7/18/2022, 12:45:00 PM"
0 Kudos