Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 258290

[solved] How to convert a Date from one Timezone to another Timezone? (moment.js library integration)

$
0
0

Hi VM Community!

 

I need to convert a date from GMT into a target timezone, for example 'Europe/Berlin' or 'Asia/Singapore'.

Currently my limitation is that the Date Class in VM doesn't support any automatic timezone conversions.

For manual conversions in the Javascript code my main issue is that I cannot handle daylight savings time switches. Any JS library that you would usually use to handle this is unavailable.

 

Any good tips on how to implement this?

 

My full requirement is to take a GMT Date and print it out in 4 strings for easy worldwide readability:

GMT

CET / CEST

SGT

PDT / PST

 

Thanks,

Steve

 

------

 

UPDATE: Solved by integrating the moment.js library.

Can be found as attachment.


Viewing all articles
Browse latest Browse all 258290

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>