can any one pls give the api code for
getting the system date format.
ie. dd/mm/yyyy or mm/dd/yyyy etc...
thanking u.
harish.
Printable View
can any one pls give the api code for
getting the system date format.
ie. dd/mm/yyyy or mm/dd/yyyy etc...
thanking u.
harish.
Hi harishKS
Use this to get the short date format of ur system.The format will be on strformattype variable
on Error GoTo dataerror1
Dim strformattype As String
ret = RegOpenKey(HKEY_CURRENT_USER, "Control Panel\International", RETVAL)
ret = RegQueryValueEx(RETVAL, "sShortDate", 0, 0, ByVal 0, lDataBufSize)
strformattype = String(lDataBufSize, Chr$(0))
ret = RegQueryValueEx(RETVAL, "sShortDate", 0, 0, ByVal strformattype, lDataBufSize)
dataerror1:
sorry icouldnt run it..
as it was showing the error
saying that no sub or funtion defined.
harish.
Const HKEY_CURRENT_USER = &H80000001
Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long ' Note that if you declare the lpData parameter as String, you must pass it By Value.
Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
it worked well.
thnaku