- 
      
 - 
        
Save alderlopez/20f3c428b9a38413adf6 to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | var secondsSinceReferenceDate = 386463600; // 2013-4-1 | |
| var referenceDate = new DateTime(2001, 1, 1); | |
| var databaseUtcTime = refdate.AddSeconds(secondsSinceReferenceDate); | |
| TimeZoneInfo timeZone; | |
| try { | |
| timeZone = TimeZoneInfo.FindSystemTimeZoneById("Europe/Dublin"); | |
| } | |
| catch (Exception) | |
| { | |
| timeZone = TimeZoneInfo.Local; | |
| } | |
| var GMTTime = TimeZoneInfo.ConvertTimeFromUtc(databaseUtcTime, GMTTimeZone); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | var secondsSinceReferenceDate = 386463600; // 2013-4-1 | |
| var referenceDate = new DateTime(2001, 1, 1); | |
| var validDate = referenceDate.AddSeconds(secondsSinceReferenceDate); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // On Windows Server the equivalent would be "GMT Standard Time" | |
| TimeZoneInfo GMTTimeZone = TimeZoneInfo.FindSystemTimeZoneById("Europe/Dublin"); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment