Example #1
0
        private static void ReadZone1970Locations(DateTimeZoneReader reader)
        {
            var count = reader.ReadCount();

            Console.WriteLine($"  Entries: {count}");
            for (int i = 0; i < count; i++)
            {
                int           latitudeSeconds  = reader.ReadSignedCount();
                int           longitudeSeconds = reader.ReadSignedCount();
                int           countryCount     = reader.ReadCount();
                StringBuilder countries        = new StringBuilder();
                for (int j = 0; j < countryCount; j++)
                {
                    countries.Append($"{reader.ReadString()} ({reader.ReadString()}), ");
                }
                if (countries.Length > 0)
                {
                    // Remove the trailing comma+space.
                    countries.Length -= 2;
                }
                string zoneId  = reader.ReadString();
                string comment = reader.ReadString();
                Console.WriteLine($"  Lat seconds: {latitudeSeconds}; long seconds: {longitudeSeconds}: countries: [{countries}]; id: {zoneId}; comment: {comment}");
            }
        }
Example #2
0
        private static void ReadZoneLocations(DateTimeZoneReader reader)
        {
            var count = reader.ReadCount();

            Console.WriteLine($"  Entries: {count}");
            for (int i = 0; i < count; i++)
            {
                int    latitudeSeconds  = reader.ReadSignedCount();
                int    longitudeSeconds = reader.ReadSignedCount();
                string countryName      = reader.ReadString();
                string countryCode      = reader.ReadString();
                string zoneId           = reader.ReadString();
                string comment          = reader.ReadString();
                Console.WriteLine($"  Lat seconds: {latitudeSeconds}; long seconds: {longitudeSeconds}: country: {countryName} ({countryCode}); id: {zoneId}; comment: {comment}");
            }
        }