The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: yaki on August 09, 2006, 02:09:33 AM

Title: GetDateFormat
Post by: yaki on August 09, 2006, 02:09:33 AM
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
Title: Re: GetDateFormat
Post by: Tedd on August 09, 2006, 10:05:58 AM
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
Title: Re: GetDateFormat
Post by: yaki on August 09, 2006, 04:53:54 PM
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
Title: Re: GetDateFormat
Post by: Darrel on August 09, 2006, 09:37:51 PM
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
Title: Re: GetDateFormat
Post by: yaki on August 09, 2006, 10:38:34 PM
thanks Darrel  :thumbu!!
Title: Re: GetDateFormat
Post by: Tedd on August 10, 2006, 10:26:37 AM
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
Title: Re: GetDateFormat
Post by: yaki on August 13, 2006, 04:00:03 AM
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
Title: Re: GetDateFormat
Post by: Tedd on August 14, 2006, 01:55:42 PM
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.