Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

set date format dd/mm/yyyy in pb

207 views
Skip to first unread message

MINESH DOSHI

unread,
Dec 8, 1998, 3:00:00 AM12/8/98
to
I want to set windows default date format to dd/mm/yyyy
if anyone have some idea about windows API which sets the date format.

Gregory R. George

unread,
Dec 8, 1998, 3:00:00 AM12/8/98
to
Minesh,

// External function declaration
Function Integer SetLocaleInfoA(UnsignedLong locale, UnsignedLong lctype,
String data) Library "kernel32.dll"
Function UnsignedLong GetSystemDefaultLCID() Library "kernel32.dll"

// Then call
SetLocaleInfoA(GetSystemDefaultLCID(), aul_LocaleType, as_info)

where aul_LocaleType is one of the following:
Constant UnsignedLong LOCALE_ILANGUAGE = 1 // 0x00000001 - language id
Constant UnsignedLong LOCALE_SLANGUAGE = 2 // 0x00000002 - localized name of
language
Constant UnsignedLong LOCALE_SENGLANGUAGE = 4097 // 0x00001001 - English
name of language
Constant UnsignedLong LOCALE_SABBREVLANGNAME = 3 // 0x00000003 - abbreviated
language name
Constant UnsignedLong LOCALE_SNATIVELANGNAME = 4 // 0x00000004 - native name
of language

Constant UnsignedLong LOCALE_ICOUNTRY = 5 // 0x00000005 - country code
Constant UnsignedLong LOCALE_SCOUNTRY = 6 // 0x00000006 - localized name of
country
Constant UnsignedLong LOCALE_SENGCOUNTRY = 4098 // 0x00001002 - English name
of country
Constant UnsignedLong LOCALE_SABBREVCTRYNAME = 7 // 0x00000007 - abbreviated
country name
Constant UnsignedLong LOCALE_SNATIVECTRYNAME = 8 // 0x00000008 - native name
of country

Constant UnsignedLong LOCALE_IDEFAULTLANGUAGE = 9 // 0x00000009 - default
language id
Constant UnsignedLong LOCALE_IDEFAULTCOUNTRY = 10 // 0x0000000A - default
country code
Constant UnsignedLong LOCALE_IDEFAULTCODEPAGE = 11 // 0x0000000B - default
oem code page
Constant UnsignedLong LOCALE_IDEFAULTANSICODEPAGE = 4100 // 0x00001004 -
default ansi code page
Constant UnsignedLong LOCALE_IDEFAULTMACCODEPAGE = 4113 // 0x00001011 -
default mac code page

Constant UnsignedLong LOCALE_SLIST = 12 // 0x0000000C - list item separator
Constant UnsignedLong LOCALE_IMEASURE = 13 // 0x0000000D - 0 = metric, 1 =
US

Constant UnsignedLong LOCALE_SDECIMAL = 14 // 0x0000000E - decimal separator
Constant UnsignedLong LOCALE_STHOUSAND = 15 // 0x0000000F - thousand
separator
Constant UnsignedLong LOCALE_SGROUPING = 16 // 0x00000010 - digit grouping
Constant UnsignedLong LOCALE_IDIGITS = 17 // 0x00000011 - number of
fractional digits
Constant UnsignedLong LOCALE_ILZERO = 18 // 0x00000012 - leading zeros for
decimal
Constant UnsignedLong LOCALE_INEGNUMBER = 4112 // 0x00001010 - negative
number mode
Constant UnsignedLong LOCALE_SNATIVEDIGITS = 19 // 0x00000013 - native ascii
0-9

Constant UnsignedLong LOCALE_SCURRENCY = 20 // 0x00000014 - local monetary
symbol
Constant UnsignedLong LOCALE_SINTLSYMBOL = 21 // 0x00000015 - intl monetary
symbol
Constant UnsignedLong LOCALE_SMONDECIMALSEP = 22 // 0x00000016 - monetary
decimal separator
Constant UnsignedLong LOCALE_SMONTHOUSANDSEP = 23 // 0x00000017 - monetary
thousand separator
Constant UnsignedLong LOCALE_SMONGROUPING = 24 // 0x00000018 - monetary
grouping
Constant UnsignedLong LOCALE_ICURRDIGITS = 25 // 0x00000019 - # local
monetary digits
Constant UnsignedLong LOCALE_IINTLCURRDIGITS = 26 // 0x0000001A - # intl
monetary digits
Constant UnsignedLong LOCALE_ICURRENCY = 27 // 0x0000001B - positive
currency mode
Constant UnsignedLong LOCALE_INEGCURR = 28 // 0x0000001C - negative currency
mode

Constant UnsignedLong LOCALE_SDATE = 29 // 0x0000001D - date separator
Constant UnsignedLong LOCALE_STIME = 30 // 0x0000001E - time separator
Constant UnsignedLong LOCALE_SSHORTDATE = 31 // 0x0000001F - short date
format string
Constant UnsignedLong LOCALE_SLONGDATE = 32 // 0x00000020 - long date format
string
Constant UnsignedLong LOCALE_STIMEFORMAT = 4099 // 0x00001003 - time format
string
Constant UnsignedLong LOCALE_IDATE = 33 // 0x00000021 - short date format
ordering
Constant UnsignedLong LOCALE_ILDATE = 34 // 0x00000022 - long date format
ordering
Constant UnsignedLong LOCALE_ITIME = 35 // 0x00000023 - time format
specifier
Constant UnsignedLong LOCALE_ITIMEMARKPOSN = 4101 // 0x00001005 - time
marker position
Constant UnsignedLong LOCALE_ICENTURY = 36 // 0x00000024 - century format
specifier (short date)
Constant UnsignedLong LOCALE_ITLZERO = 37 // 0x00000025 - leading zeros in
time field
Constant UnsignedLong LOCALE_IDAYLZERO = 38 // 0x00000026 - leading zeros in
day field (short date)
Constant UnsignedLong LOCALE_IMONLZERO = 39 // 0x00000027 - leading zeros in
month field (short date)
Constant UnsignedLong LOCALE_S1159 = 40 // 0x00000028 - AM designator
Constant UnsignedLong LOCALE_S2359 = 41 // 0x00000029 - PM designator

Constant UnsignedLong LOCALE_ICALENDARTYPE = 4105 // 0x00001009 - type of
calendar specifier
Constant UnsignedLong LOCALE_IOPTIONALCALENDAR = 4107 // 0x0000100B -
additional calendar types specifier
Constant UnsignedLong LOCALE_IFIRSTDAYOFWEEK = 4108 // 0x0000100C - first
day of week specifier
Constant UnsignedLong LOCALE_IFIRSTWEEKOFYEAR = 4109 // 0x0000100D - first
week of year specifier

Constant UnsignedLong LOCALE_SDAYNAME1 = 42 // 0x0000002A - long name for
Monday
Constant UnsignedLong LOCALE_SDAYNAME2 = 43 // 0x0000002B - long name for
Tuesday
Constant UnsignedLong LOCALE_SDAYNAME3 = 44 // 0x0000002C - long name for
Wednesday
Constant UnsignedLong LOCALE_SDAYNAME4 = 45 // 0x0000002D - long name for
Thursday
Constant UnsignedLong LOCALE_SDAYNAME5 = 46 // 0x0000002E - long name for
Friday
Constant UnsignedLong LOCALE_SDAYNAME6 = 47 // 0x0000002F - long name for
Saturday
Constant UnsignedLong LOCALE_SDAYNAME7 = 48 // 0x00000030 - long name for
Sunday
Constant UnsignedLong LOCALE_SABBREVDAYNAME1 = 49 // 0x00000031 -
abbreviated name for Monday
Constant UnsignedLong LOCALE_SABBREVDAYNAME2 = 50 // 0x00000032 -
abbreviated name for Tuesday
Constant UnsignedLong LOCALE_SABBREVDAYNAME3 = 51 // 0x00000033 -
abbreviated name for Wednesday
Constant UnsignedLong LOCALE_SABBREVDAYNAME4 = 52 // 0x00000034 -
abbreviated name for Thursday
Constant UnsignedLong LOCALE_SABBREVDAYNAME5 = 53 // 0x00000035 -
abbreviated name for Friday
Constant UnsignedLong LOCALE_SABBREVDAYNAME6 = 54 // 0x00000036 -
abbreviated name for Saturday
Constant UnsignedLong LOCALE_SABBREVDAYNAME7 = 55 // 0x00000037 -
abbreviated name for Sunday
Constant UnsignedLong LOCALE_SMONTHNAME1 = 56 // 0x00000038 - long name for
January
Constant UnsignedLong LOCALE_SMONTHNAME2 = 57 // 0x00000039 - long name for
February
Constant UnsignedLong LOCALE_SMONTHNAME3 = 58 // 0x0000003A - long name for
March
Constant UnsignedLong LOCALE_SMONTHNAME4 = 59 // 0x0000003B - long name for
April
Constant UnsignedLong LOCALE_SMONTHNAME5 = 60 // 0x0000003C - long name for
May
Constant UnsignedLong LOCALE_SMONTHNAME6 = 61 // 0x0000003D - long name for
June
Constant UnsignedLong LOCALE_SMONTHNAME7 = 62 // 0x0000003E - long name for
July
Constant UnsignedLong LOCALE_SMONTHNAME8 = 63 // 0x0000003F - long name for
August
Constant UnsignedLong LOCALE_SMONTHNAME9 = 64 // 0x00000040 - long name for
September
Constant UnsignedLong LOCALE_SMONTHNAME10 = 65 // 0x00000041 - long name for
October
Constant UnsignedLong LOCALE_SMONTHNAME11 = 66 // 0x00000042 - long name for
November
Constant UnsignedLong LOCALE_SMONTHNAME12 = 67 // 0x00000043 - long name for
December
Constant UnsignedLong LOCALE_SMONTHNAME13 = 4110 // 0x0000100E - long name
for 13th month (if exists)
Constant UnsignedLong LOCALE_SABBREVMONTHNAME1 = 68 // 0x00000044 -
abbreviated name for January
Constant UnsignedLong LOCALE_SABBREVMONTHNAME2 = 69 // 0x00000045 -
abbreviated name for February
Constant UnsignedLong LOCALE_SABBREVMONTHNAME3 = 70 // 0x00000046 -
abbreviated name for March
Constant UnsignedLong LOCALE_SABBREVMONTHNAME4 = 71 // 0x00000047 -
abbreviated name for April
Constant UnsignedLong LOCALE_SABBREVMONTHNAME5 = 72 // 0x00000048 -
abbreviated name for May
Constant UnsignedLong LOCALE_SABBREVMONTHNAME6 = 73 // 0x00000049 -
abbreviated name for June
Constant UnsignedLong LOCALE_SABBREVMONTHNAME7 = 74 // 0x0000004A -
abbreviated name for July
Constant UnsignedLong LOCALE_SABBREVMONTHNAME8 = 75 // 0x0000004B -
abbreviated name for August
Constant UnsignedLong LOCALE_SABBREVMONTHNAME9 = 76 // 0x0000004C -
abbreviated name for September
Constant UnsignedLong LOCALE_SABBREVMONTHNAME10 = 77 // 0x0000004D -
abbreviated name for October
Constant UnsignedLong LOCALE_SABBREVMONTHNAME11 = 78 // 0x0000004E -
abbreviated name for November
Constant UnsignedLong LOCALE_SABBREVMONTHNAME12 = 79 // 0x0000004F -
abbreviated name for December
Constant UnsignedLong LOCALE_SABBREVMONTHNAME13 = 4111 // 0x0000100F -
abbreviated name for 13th month (if exists)

Constant UnsignedLong LOCALE_SPOSITIVESIGN = 80 // 0x00000050 - positive
sign
Constant UnsignedLong LOCALE_SNEGATIVESIGN = 81 // 0x00000051 - negative
sign
Constant UnsignedLong LOCALE_IPOSSIGNPOSN = 82 // 0x00000052 - positive sign
position
Constant UnsignedLong LOCALE_INEGSIGNPOSN = 83 // 0x00000053 - negative sign
position
Constant UnsignedLong LOCALE_IPOSSYMPRECEDES = 84 // 0x00000054 - mon sym
precedes pos amt
Constant UnsignedLong LOCALE_IPOSSEPBYSPACE = 85 // 0x00000055 - mon sym sep
by space from pos amt
Constant UnsignedLong LOCALE_INEGSYMPRECEDES = 86 // 0x00000056 - mon sym
precedes neg amt
Constant UnsignedLong LOCALE_INEGSEPBYSPACE = 87 // 0x00000057 - mon sym sep
by space from neg amt

Constant UnsignedLong LOCALE_FONTSIGNATURE = 88 // 0x00000058 - font
signature
Constant UnsignedLong LOCALE_SISO639LANGNAME = 89 // 0x00000059 - ISO
abbreviated language name
Constant UnsignedLong LOCALE_SISO3166CTRYNAME = 90 // 0x0000005A - ISO
abbreviated country name


HTH,
Greg

--
______________________________
Gregory R. George
Greg_...@AscensionLabs.com
Ascension Labs, LLC
www.AscensionLabs.com

MINESH DOSHI wrote in message <366D188B...@ad1.vsnl.net.in>...

Oliver Willandsen [European Commission]

unread,
Dec 9, 1998, 3:00:00 AM12/9/98
to
On Tue, 8 Dec 1998 13:13:52 -0700,
in powersoft.public.powerbuilder.general
Hi,

is it really necessary to use API calls for this ??

How about

string ls_shortdate

RegistryGet("HKEY_CURRENT_USER\Control Panel\International", "sShortDate",
ls_shortdate)

If Not ls_shortdate = 'dd/mm/yyyy' Then
RegistrySet("HKEY_CURRENT_USER\Control Panel\International", "sShortDate",
'dd/mm/yyyy')
End If


???

Regards
Oliver Willandsen
European Commission - http://europa.eu.int
Remove PAS_DE_PUB from Email adress

All comments represent my own opinion and may not in any circumstance
be regarded as stating an official position of the European Commission

European Parliament - http://europarl.eu.int
European Council - http://ue.eu.int
European Central Bank - http://www.ecb.int
Other European Union sites - http://europa.eu.int/en/agencies.html
or
http://europa.eu.int/index-en.htm

Gregory R. George

unread,
Dec 9, 1998, 3:00:00 AM12/9/98
to
Oliver,

I'd like to think that using the API would insulate us from NT/95/98
registry differences as well as any future registry key or location
changes... but it could be overkill.

-Greg

--
______________________________
Gregory R. George
Greg_...@AscensionLabs.com
Ascension Labs, LLC
www.AscensionLabs.com

Oliver Willandsen [European Commission] wrote in message ...


>On Tue, 8 Dec 1998 13:13:52 -0700,
> in powersoft.public.powerbuilder.general

<snip>

Steve Field

unread,
Dec 15, 1998, 3:00:00 AM12/15/98
to
MINESH DOSHI <sem...@ad1.vsnl.net.in> wrote:
> I want to set windows default date format to dd/mm/yyyy
> if anyone have some idea about windows API which sets the date format.

It's not a good idea because this item is under user control, however,
I don't know the API call if there is one, but you can look for/modify
the [Intl] section of the Win.INI file and also several places under
"International" in the Registry.

What are you trying to accomplish overall? Just curious.

--

+ Steve Field (Sci...@compuserve.com)
+ On 12/15/98 19:33 PT
Using OUI 1.8 Pro from http://www.peaktopeak.com


0 new messages