time.h for pocket pc in vs 2005
Hi,
I want to use strftime for my program in pocket pc 2003se.
I write a code like below:
time_t vtime;
time(&vtime);
today = localtime(&vtime);
char tmpbuf[128];
strftime(tmpbuf,128,
"Today is %A, day %d of %B in the year %Y.\n",today);
i included "time.h"
when i compile, i met the error:
Link2019: unresolved external sysmbol strftime ....
Can you show me how to get system time in vs2005 beta for pocket pc 2003.
Thank you.
Look forward to hearing from you
Julien
[560 byte] By [
JulienT] at [2008-1-27]
Most of the CRT time api's aren't support on Windows CE.
You could use wcsftime to convert the time as in:
wchar_t string[150];
struct tm time = {0,0,12,23,11,93};
wcsftime(string, 150, "%A %B %d %Y", &time);
printf("%s", string);
return 0;
Unhappily time() and localtime() aren't available on CE and switching to wcsftime won't enable your original code to run as is.
You can use GetLocalTime() and GetTimeFormat() to accomplish similar behavior to what you originally were looking for.
Hope this helps.