News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

GetDateFormat

Started by yaki, August 09, 2006, 02:09:33 AM

Previous topic - Next topic

yaki

hi
I have an application calendar using GetDateFormat ,GetSystemTime.   and I'm trying to
change the day names to display always English names for other languages, I tried to change  LOCALE_SDAYNAME without success .
Any idea?

Thanks for all

Tedd

The first parameter to GetDateFormat takes a locale-id -- this says which language to give the date in. So I assume if you say you want the date in english, then that is what it will give you?
..unless you want the date in the user's locale format, but with the day names in english, then in you're in for some fun :bdg
No snowflake in an avalanche feels responsible.

yaki

hi
sorry for my poor english.

I want some thing like "ctime" ,
#include <stdio.h>
#include <time.h>

int main()
{
   time_t tm;
   tm = time(NULL);
   printf(ctime(&tm));

   return 0;
}
the output is in english language :
Wed Aug 09 16:41:56 2006 
with GetDateFormat i have a French names output
Mer Aou 09 16:41:56   2006
because I use frenche windows

thanks

Darrel

Give this a try:

    mov     eax,SUBLANG_ENGLISH_US
    shl     eax,10
    or      eax,LANG_ENGLISH
    mov     edx,SORT_DEFAULT
    shl     edx,16
    or      eax,edx
    mov     English_Identifier,eax


or you can simply use 0409h for your first parameter.  :8)

HTH,

Darrel

yaki

thanks Darrel  :thumbu!!

Tedd

ctime gives the names in english because the english names are saved in the exe and that is the list used, not the names provided by windows :wink
No snowflake in an avalanche feels responsible.

yaki

hi
there are no names of month saved in  .exe, you can check by compiling and débuging the code ....
moreover  with :
invoke GetDateFormat, 0409h, 0 , addr lpDate, addr lpFormat, addr lpDateStr,MAX_DATE_LEN

i have english names

thanks

Tedd

Then it uses the crt (c runtime) library - so the names are stored in a .dll
The reason is still the same - the names in that dll are the english ones.
No snowflake in an avalanche feels responsible.