i am in situation where i need to get user pc timezone info by JavaScript. if i get the timezone info then i like to feed those info to Noda Time library just to get user side current date and time.
the reason i need to get user side date and time based on user pc timezone because i do not want to depend on user pc date & time because i am developing a sensitive apps where we need to show timezone wise date. i could easily fetch user pc date & time but there is one risk if user change his date & time then we will not be able to detect it at runtime.
same way user can change his timezone but it is rare case.
here i got a .net code where we could put zoneid and get current date time based on timezone info.
var zone = TimeZoneInfo.FindSystemTimeZoneById(zoneId);
var now = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, zone);
same way using noda library i got a code where we could put zoneid and get current date time based on timezone info.
// zoneId is the TZDB ID, e.g. "Europe/London"
DateTimeZone zone = DateTimeZoneProviders.Tzdb[zoneId];
// clock would be an IClock implementation of some description; rather than
// having a static method, an interface encourages testability.
ZonedDateTime now = clock.Now.InZone(zone);
so my question is how to get zoneid by javascript and next i need to get user pc local time based on zoneid which i could put to .net datetime class or noda library.
if anyone has any idea then please share with me to achieve my goal. thanks