timespan in C++
Hi,
I have port this code from c# to c++ :
TimeSpan ts = DateTime.Now - new DateTime( 1900, 1, 1 ,0, 0, 0, 0 ); UInt32
ts32 = (UInt32)(ts.TotalSeconds);
UInt32 tms32 = (UInt32)ts.TotalMilliseconds;
i tried with:
SYSTEMTIME *systime;
systime = new SYSTEMTIME;
GetSystemTime(systime);
CTime starttime(1970, 1, 1, 1, 0, 0, 0);
CTime endtime;
endtime = CTime::GetCurrentTime();
CTimeSpan TimeSpan=endtime-starttime;
unsigned __int32 ts32 = (unsigned __int32) systime->wMilliseconds ;
//systime->wSecond);
unsigned __int32 tms32 = (unsigned __int32) TimeSpan.GetTotalSeconds();
But i still get wrong results. What have i doing wrong ?
date: Mon, 24 Apr 2006 08:09:02 -0700
author: knopper