Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- class TimeTest
- {
- public static void Main()
- {
- Console.WriteLine("Automatic year checking starting from 2008 down to 1970." ) ;
- Console.WriteLine("Only years that do not result in -2 hour changes will be displayed." ) ;
- TimeSpan CorrectTimespan = new TimeSpan(-2, 0,0) ;
- int year = 2008 ;
- while (year > 1960)
- {
- DateTime test = new DateTime(year, 10, 5, 7, 5, 9, 10, DateTimeKind.Utc);
- TimeSpan Difference = (test - test.ToLocalTime()) ;
- if ( Difference != CorrectTimespan)
- {
- Console.WriteLine("{0} has a UTC-GMT+2 diff of {1}", year, Difference );
- }
- year-- ;
- }
- }
- }
Add Comment
Please, Sign In to add comment