Conversion of DWORD to time
-
I have a DWORD and i want to convert it into a time format. Eg. DWORD is = 41107ECE I want it should be in format as = 2004/08/04 Wed 06:14:38 UTC How can I do this conversion? Plz help me. Regards Nikesh
-
I have a DWORD and i want to convert it into a time format. Eg. DWORD is = 41107ECE I want it should be in format as = 2004/08/04 Wed 06:14:38 UTC How can I do this conversion? Plz help me. Regards Nikesh
Clearly that depends on the encoding of the date in the
DWORD
, which you haven't mentioned.Steve
-
I have a DWORD and i want to convert it into a time format. Eg. DWORD is = 41107ECE I want it should be in format as = 2004/08/04 Wed 06:14:38 UTC How can I do this conversion? Plz help me. Regards Nikesh
-
I have a DWORD and i want to convert it into a time format. Eg. DWORD is = 41107ECE I want it should be in format as = 2004/08/04 Wed 06:14:38 UTC How can I do this conversion? Plz help me. Regards Nikesh
This way:
char buf[0x20];
DWORD dw = 0x41107ECE;
time_t t = dw;
struct tm * ptime;
ptime=gmtime(&t);
strftime(buf,0x20,"%Y/%m/%d %a %H:%M:%S UTC\n",ptime);
printf(buf);:)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]