Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get the short and long date format string
Message
From
21/06/2007 11:40:37
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01234713
Message ID:
01234744
Views:
14
This message has been marked as the solution to the initial question of the thread.
Hi,

try this one ...
#DEFINE LOCALE_SSHORTDATE	0x1F
#DEFINE LOCALE_SLONGDATE	0x20
#DEFINE LOCALE_USER_DEFAULT	0x400

DECLARE INTEGER GetLocaleInfo IN kernel32.dll INTEGER nLocale, INTEGER nType, STRING @ pBuffer, INTEGER nBufferSize

?GetLocaleInfoEx(LOCALE_SSHORTDATE)
?GetLocaleInfoEx(LOCALE_SLONGDATE)

FUNCTION GetLocaleInfoEx(nType)
	LOCAL lcInfo, lnRet
	lcInfo = SPACE(256)
	lnRet = GetLocaleInfo(LOCALE_USER_DEFAULT, nType, @lcInfo, 256)
	IF lnRet > 0
		RETURN LEFT(lcInfo,lnRet-1)
	ELSE
		RETURN '' && Error - call GetLastError, FormatMessage API's for error information
	ENDIF
ENDFUNC
Regards
Christian
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform