コード例 #1
0
        public async Task <TimeZoneInfo> GetTimeZoneInfoAsync(string lat, string lon)
        {
            string json = await _timezoneConverter.GetTimeZoneJsonFromLatLonAsync(lat, lon);

            string timeZoneId = JObject.Parse(json)["timeZoneId"].ToString();

            try
            {
                string       olsonTimeZone = _olsonWindowsTimes[timeZoneId];
                TimeZoneInfo timeZoneInfo  = TimeZoneInfo.FindSystemTimeZoneById(olsonTimeZone);
                return(timeZoneInfo);
            }
            catch (Exception e)
            {
                throw e;
            }
        }