I want to display a 2nd timezone and I can use Gregorian.localMoment but that takes in a time. What would be the code to get the correct local time including DST?
I could use localMoment but that requires passing in local time for that timezone but I only have the current local time:
// EXAMPLE AMS (+1 or +2 for DST) var where = new Position.Location({ :latitude => 52.4, :longitude => 4.9, :format => :degrees, }); var tz = Gregorian.localMoment(where, Time.now()).getOffset()/3600; var info = Gregorian.info(tz, Time.FORMAT_SHORT); // THIS WILL NOT WORK SINCE Time.now() is local time.
I'm guessing you would first have to figure out delta in timezones and then offset that perhaps?