I have a FILETIME structure.
How can I convert it into a string, using user language?

Store "Date and Time picker" value in a file as 64 bit integer (the FILETIME structure).
Then I want to read this value and print it into a listview as a string, but I don't know how to get months name in the user defined language.
The format of the string should be "d MMMM yyyy"
Posted on 2004-02-12 12:25:37 by greenant
Use the GetDateFormat function it will format the date to the local output. You will have to use FileTimeToSystemTime to convert the FILETIME structure first.

invoke FileTimeToSystemTime,OFFSET dqFileTime,OFFSET stLocal

invoke GetDateFormat,LOCALE_SYSTEM_DEFAULT,NULL,\
OFFSET stLocal,"d MMMM yyyy",OFFSET szFileTime,64


PS: If you need to include the time in the date string:

invoke FileTimeToSystemTime,OFFSET dqFileTime,OFFSET stLocal

invoke GetDateFormat,LOCALE_SYSTEM_DEFAULT,NULL,\
OFFSET stLocal,"d MMM yyyy",OFFSET szTempDate,64
invoke GetTimeFormat,LOCALE_SYSTEM_DEFAULT,NULL,\
OFFSET stLocal,"hh:mm tt",OFFSET szTempTime,64
invoke wsprintf,OFFSET szFileTime,"%s %s",OFFSET szTempDate,OFFSET szTempTime
add esp,16
Posted on 2004-02-12 12:56:13 by donkey
Thanks
Posted on 2004-02-12 14:07:46 by greenant