Here is a function from VBNet that does just that.
Copy it all into a new module then look at the function ListDateFormats() which prints out the long & short date formats.
hth
Ben
Option Compare Database
Option Explicit
'--------------------------------------------------------------
' Copyright ©1996-2002 VBnet, Randy Birch, All Rights Reserved.
' Terms of use
' Modified slightly to run in Access & used instructions on
' VBNet to return current users settings rather than system
' default.
'--------------------------------------------------------------
Public Const DATE_LONGDATE As Long = &H2
Public Const DATE_SHORTDATE As Long = &H1
Public Const LOCALE_SLANGUAGE As Long = &H2 'localized name of language
Public Const LOCALE_SSHORTDATE As Long = &H1F 'short date format string
Public Const LOCALE_SLONGDATE As Long = &H20 'long date format string
Public Declare Function GetThreadLocale Lib "kernel32" () As Long
Public Declare Function GetSystemDefaultLCID Lib "kernel32" () As Long
Public Declare Function GetUserDefaultLCID Lib "kernel32" () As Long
Public Declare Function GetLocaleInfo Lib "kernel32" _
Alias "GetLocaleInfoA" _
(ByVal Locale As Long, _
ByVal LCType As Long, _
ByVal lpLCData As String, _
ByVal cchData As Long) As Long
Public Declare Function EnumDateFormats Lib "kernel32" _
Alias "EnumDateFormatsA" _
(ByVal lpDateFmtEnumProc As Long, _
ByVal Locale As Long, _
ByVal dwFlags As Long) As Long
Public Declare Sub CopyMemory Lib "kernel32" _
Alias "RtlMoveMemory" _
(Destination As Any, _
Source As Any, _
ByVal Length As Long)
Sub ListDateFormats()
Dim LCID As Long
'get the system's locale ID. Where the
'user's locale ID is required, call
'GetUserLocaleLCID instead.
LCID = GetUserDefaultLCID()
'show localized name of language
Debug.Print GetUserLocaleInfo(LCID, LOCALE_SLANGUAGE)
'Show the Long date format string for the LCID in use
Debug.Print "Long Date Format: " & GetUserLocaleInfo(LCID, LOCALE_SLONGDATE)
'Show the Short date format string for the LCID in use
Debug.Print "Short Date Format: " & GetUserLocaleInfo(LCID, LOCALE_SSHORTDATE)
End Sub
Public Function GetUserLocaleInfo(ByVal dwLocaleID As Long, _
ByVal dwLCType As Long) As String
Dim sReturn As String
Dim r As Long
'call the function passing the Locale type
'variable to retrieve the required size of
'the string buffer needed
r = GetLocaleInfo(dwLocaleID, dwLCType, sReturn, Len(sReturn))
'if successful..
If r Then
'pad the buffer with spaces
sReturn = Space$(r)
'and call again passing the buffer
r = GetLocaleInfo(dwLocaleID, dwLCType, sReturn, Len(sReturn))
'if successful (r > 0)
If r Then
'r holds the size of the string
'including the terminating null
GetUserLocaleInfo = Left$(sReturn, r - 1)
End If
End If
End Function
----------------------------------------------
Ben O'Hara
"Where are all the stupid people from...
...And how'd they get so dumb?"
NoFX-The Decline
----------------------------------------------