In .Net I can use the following to figure out what time it is in a specified timezone:
var targetDate = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, "Atlantic Standard Time");
I've been trying to figure out a way to do this in Javascript, but so far no luck. I was able to find the following: http://www.techrepublic.com/article/convert-the-local-time-to-another-time-zone-with-this-javascript/ which has some details, if I can specify an offset, but I cant seem to figure out how to get that from a specified timezone (from the currentTimezone its as easy as myDate.getTimezoneOffset()
).
Again in .Net I could do this with:
TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById("Atlantic Standard Time");
TimeSpan offset = tzi.GetUtcOffset( myDateTime);