Are there any way to check the system for the regional date? I need to vary the table struction/input to the tables depending on Europe type date or US type date.
I have looked at the SYS() numbers and can not determine what I need. Please help!
DO case
CASE nOrder = 0
cReturn = "month/day/year"
CASE nOrder = 1
cReturn = "day/month/year"
CASE nOrder = 2
cReturn = "year/month/day"
ENDCASE
RETURN cReturn
ENDFUNC
Slighthaze = NULL
[ul][li]FAQ184-2483 An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
I believe the question is,
is it possible to idenify from within foxpro, what is the system date followed by OS, so that the same can be set in VFP application at startup ?
I am unable to think, since any VFP attempt will follow the VFPs default set and so to get the systems DATE format has to be using some API. I am short on that :-(
Yeah that is what I thought too...I posted the code up above for finding the regional date order. Small modification using Set Date to would allow for this. I should note that I am only returning the short date format system setting in my posted code.
Slighthaze = NULL
[ul][li]FAQ184-2483 An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
One important point is that often, users system do not represent their regional setting. Often settings by default are set for US format when the OS is installed. HOwever in the data entry applications users are specific. They dont care that much with OS settings. SO simply following the system date format is not also healthy.
Instead asking the ueer for a choice and saving it somewhere could be a better idea.
I tested slighthaze's code and in the process whatever I changed I thought I will post here. Credit to Slighthhaze.
********************************
sysDate = RegionalDateSetting()
SET DATE (sysDate)
********************************
Function RegionalDateSetting()
#DEFINE LOCALE_IDATE 0x21
LOCAL cReturn, cBuffer, nResult, nUserDefaultLocale, nOrder
Declare INTEGER GetLocaleInfo in kernel32 as GetLocaleInfoA ;
Long,Long,String,Long
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.