Click to See Complete Forum and Search --> : Regional Settings
R@emdonck
Dec 16th, 1999, 10:41 AM
Hi,
Who knows how to read the "Short date style" & "Date seperator" from the regional settings ?? And Who knows how to change those value's ??
OS = 95, 98 & NT
R@emdonck
I'm not sure if it's the easiest way to do what you're trying to do but in the past I have used 2 API calls to get the values from the registry. To read the values use the RegQueryValueEx API and ato edit them use the RegSetValueEx API.
The registry values that you are interested in are: HKEY_CURRENT_USER\Control Panel\International\sDate
and
HKEY_CURRENT_USER\Control Panel\International\sShortDate
smalig
Dec 16th, 1999, 04:29 PM
You can use Format() function
MyStr = Format(Time, "Short Time")
MyStr = Format(Date, "Short Date")
And for the Date separator:
Function DateSeparator() As String
Dim s As String * 1
s = Right(Date, 3)
DateSeparator = s
End Function
Usage: MsgBox "Date separator is " & DateSeparator
------------------
smalig
smalig@hotmail.com
http://vbcode.webhostme.com/
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.