kijato

OLETIME to DateTime πŸ‘

Feb 22nd, 2025 (edited)
737
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | Source Code | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5.     static void Main()
  6.     {
  7.         byte[] bytes = new byte[] { 190, 110, 116, 207, 178, 140, 229, 64 };
  8.         long l = BitConverter.ToInt64( bytes, 0 );    // 4676298487706709694
  9.         double d = BitConverter.Int64BitsToDouble(l); // 44133.5878240741
  10.         DateTime dt = DateTime.FromOADate( d );       // 2020.10.29. 14:06:28
  11.         Console.WriteLine( dt );
  12.     }
  13. }
  14.  
Advertisement
Add Comment
Please, Sign In to add comment