program in c# find time :
byte []a = new byte {224,198,23,200}; Console.WriteLine( "time {0} " ,BitConverter.ToInt32(a,0));output: -939765856
what wrong in program ,i use Convert.ToDateTime but not has correct output
i want a 32 bit integer that specifies(in seconds since midnight,january 1, 1904)
Loading
VulpesPosted Oct 28, 2013, 3:18 PM
If we assume that we get:
byte[] a = new byte[] {224,198,23,200};
uint ui = BitConverter.ToUInt32(a,0);
DateTime dt = new DateTime(1904, 1, 1);
dt = dt.AddSeconds(ui);
Console.WriteLine(dt);
This gives 03:24:00 on 18 May 2010.
VulpesPosted Oct 29, 2013, 4:12 AM
I only used 1/1/1904 because this was the date you used yourself in your opening post.
zozo ahmedPosted Oct 28, 2013, 11:49 PM
i am beginner in c# and i need to understand why use year (1904)
VulpesPosted Oct 28, 2013, 4:39 PM
Ignoring any adjustment for local time/UTC:
This gives:
224 102 83 206
zozo ahmedPosted Oct 28, 2013, 3:42 PM