Guest User

Untitled

a guest
Apr 26th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3.  
  4. class TimeTest
  5. {
  6.  
  7. public static void Main()
  8. {
  9. Console.WriteLine("Automatic year checking starting from 2008 down to 1970." ) ;
  10. Console.WriteLine("Only years that do not result in -2 hour changes will be displayed." ) ;
  11.  
  12. TimeSpan CorrectTimespan = new TimeSpan(-2, 0,0) ;
  13.  
  14. int year = 2008 ;
  15. while (year > 1960)
  16. {
  17. DateTime test = new DateTime(year, 10, 5, 7, 5, 9, 10, DateTimeKind.Utc);
  18. TimeSpan Difference = (test - test.ToLocalTime()) ;
  19. if ( Difference != CorrectTimespan)
  20. {
  21. Console.WriteLine("{0} has a UTC-GMT+2 diff of {1}", year, Difference );
  22. }
  23. year-- ;
  24. }
  25.  
  26. }
  27. }
Add Comment
Please, Sign In to add comment