Skip to main content
Known Participant
February 11, 2022
Question

time zone convert

  • February 11, 2022
  • 1 reply
  • 1052 views

Good Day all,

I have my date and time formatted as dd-mmm-yy hh:mm in local time in one area but need to convert to zulu/utc in another area. I've found a few time but nothing that would work for me. I do not need to convert the right now time, I need to convert a time that's already inputted within another field. 

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
February 11, 2022

You can find the offset of the current time-zone (from UTC, in minutes) like this:

 

new Date().getTimezoneOffset()

 

Then if you know the offset of the time-zone you want to convert it to, just calculate the difference between the two and add (or subtract) the desired amount from your Date object.

TP80Author
Known Participant
February 14, 2022

Thank you for the feed back, I'm still very new at this and trying to build it correctly. Do I need to build it as a function?

 

var dateConvert = "Text53";

function ConvertDate (nDate) {

newDate("dateConvert").getTimezoneOffset() / 360

}

 

 

TP80Author
Known Participant
February 14, 2022

Tex53 being the area where the date is being held