M Mattias Sjögren Apr 29, 2004 #2 Could you tell me how to convert DateTime to UInt32 in C#. Click to expand... How (in what format) do you want the date to be stored in the uint value? Mattias
Could you tell me how to convert DateTime to UInt32 in C#. Click to expand... How (in what format) do you want the date to be stored in the uint value? Mattias
X XingZheng Apr 29, 2004 #3 Hi This is the code in Visual C++ time_t timeNow; UINT nSeed = time(&timeNow); How to get nSeed in C# when we have DateTime.Now?
Hi This is the code in Visual C++ time_t timeNow; UINT nSeed = time(&timeNow); How to get nSeed in C# when we have DateTime.Now?
M Mattias Sjögren Apr 29, 2004 #4 This is the code in Visual C++ time_t timeNow; UINT nSeed = time(&timeNow); How to get nSeed in C# when we have DateTime.Now? Click to expand... time_t contains the number of seconds since midnight 1/1/1970, so something like this may give you what you want TimeSpan ts = DateTime.Now - new DateTime( 1970, 1, 1 ); uint nSeed = (uint)ts.TotalSeconds; Mattias
This is the code in Visual C++ time_t timeNow; UINT nSeed = time(&timeNow); How to get nSeed in C# when we have DateTime.Now? Click to expand... time_t contains the number of seconds since midnight 1/1/1970, so something like this may give you what you want TimeSpan ts = DateTime.Now - new DateTime( 1970, 1, 1 ); uint nSeed = (uint)ts.TotalSeconds; Mattias
R Remigiusz Samosiuk Apr 30, 2004 #5 if you can use long type instead of uint32 there is Ticks property From MSDN: public long Ticks {get;} The value of this property is the number of 100-nanosecond intervals that have elapsed since 12:00 A.M., January 1, 0001.
if you can use long type instead of uint32 there is Ticks property From MSDN: public long Ticks {get;} The value of this property is the number of 100-nanosecond intervals that have elapsed since 12:00 A.M., January 1, 0001.