Subject | Re: Date format issue |
---|---|
Author | Aage Johansen |
Post date | 2001-02-14T20:41:40Z |
I thought Delphi's StrToDate worked fine as long as your date is as defined
by the RegionalSettings (or defined by setting the date format in the
app). Using the Swedish date format when having the date format defined
for Norwegian dates will fail, but using Norwegian dates in Norway is not a
problem for StrToDate.
You will, however, _not_ get away with a hardcoded US format date in a
program running with (f.ex.) Swedish date format. In this case I put the
date into an EncodeDate(year,month,day) thingy.
Could it be otherwise?
IIRC
Aage J.
Helen wrote:
Delphi, along with Paradox and DBase, too, when Borland had it, is really
mean about date formats. StrToDate works only on the US mm/dd/yy format so
if one lives in the International community, one has to do all sorts of
weird stuff with DecodeDate and EncodeDate to actually have your Delphi app
recognise and convert other formats properly.
-----------------------
by the RegionalSettings (or defined by setting the date format in the
app). Using the Swedish date format when having the date format defined
for Norwegian dates will fail, but using Norwegian dates in Norway is not a
problem for StrToDate.
You will, however, _not_ get away with a hardcoded US format date in a
program running with (f.ex.) Swedish date format. In this case I put the
date into an EncodeDate(year,month,day) thingy.
Could it be otherwise?
IIRC
Aage J.
Helen wrote:
Delphi, along with Paradox and DBase, too, when Borland had it, is really
mean about date formats. StrToDate works only on the US mm/dd/yy format so
if one lives in the International community, one has to do all sorts of
weird stuff with DecodeDate and EncodeDate to actually have your Delphi app
recognise and convert other formats properly.
-----------------------