0

According to my table I have a column like Timezone standard name in which data as Like "Indian standard time", now I want to match this name by using Geo Time Zone package so how it can be done? while Geo time Zone Package return only time zone like "Europe/London"... eg:-

string tz = TimeZoneLookup.GetTimeZone(52.3702157, 4.8951679).Result
SELECT TimeZoneId FROM TimeZone WHERE NodaTimeZone LIKE '" + tz + "' OR GoogleTimeZoneName LIKE '" +  + "' ";

Actually I want Timezone name as googleTimeZoneName by GeoTimeZonePackage, now I got the output from Geotimezone package as same as TimeZoneId of google.

Srini V
  • 11,045
  • 14
  • 66
  • 89

1 Answers1

0

By using NodaTime, you are able to get the corresponding windows timezone id. Check this answer please.

using System;
using System.Linq;
using NodaTime.TimeZones;

namespace CodeTesting
{
    class Program
    {
        static void Main()
        {
            string zoneName = "Europe/London";

            var tz = TzdbDateTimeZoneSource.Default.WindowsMapping.MapZones.FirstOrDefault(o => o.TzdbIds.Contains(zoneName)).WindowsId;

            Console.WriteLine(tz);

            Console.ReadKey();
        }
    }
}
Timeless
  • 7,338
  • 9
  • 60
  • 94