Patrick and Jeremy,
Thanks for your reply. My problem is not only related to STRTODATE
function, it's also the problem the TDBEdit with TDateField underneath, and
all other related issues. The reason I asked for STRTODATE is mainly
because I have an image that Delphi will doing all DATE related things
using STRTODATE logic.
I know SQL is using 50 as a fixed window, but whatever the window is used,
it's better that just add currency century - at least my customer s reckon.
So what I realy want to know is how Delphi 4.02 treat 2 digit year.
At 18:39 09/02/1999 +1100, you wrote:
>I copied the STRTODATE function and associated functions/procedures that it
>uses, and put it into another pas file, and made an alteration in the
>strtodate where it mentions 1900 (I think it is) and basically went :-
>
>if year < 50 then
> Year:=year+2000;
>if year >=50 then
> Year:=Year+1900;
>
>OR something like that anyway.
>I chose 50 as that is SQL servers cut off for fixed windowing Y2k Dates.
>Other MS Office stuff uses 29 or 25...one of the 2, or it might be
>30....forget right now.
>
>If you have no luck, email em priv. and I will fire you my D3 Y2k routiens.
>
>
>Cheers, Jeremy Coulter
>
>-----Original Message-----
>From: Patrick Dunford [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, February 09, 1999 20:27
>To: Multiple recipients of list delphi
>Subject: RE: [DUG]: Y2K Issues - StrToDate
>
>
>
>> -----Original Message-----
>> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
>> Behalf Of Edward Huang
>> Sent: Tuesday, 9 February 1999 16:49
>> To: Multiple recipients of list delphi
>> Subject: [DUG]: Y2K Issues - StrToDate
>>
>>
>> Hi, Group,
>>
>> I'm still using Delphi 3.02 at moment, and notice that StrToDate funtion
>> does not treat 2 digit year nicely. e.g StrToDate('01/01/01') returns
>> 01/01/1901, not 01/01/2001 which should be the one many people want.
>
>How is Delphi supposed to know that? It is merely following the convention
>of the day (omitting the digits of the current century). If you want 2001
>then put 20 in front of the year and feed that into StrToDate !
>
>I would rather have any day a scheme where I can tell Delphi exactly the
>date I want than to have it guess and get it wrong.
>
><snip>
>
>============================================
>Views contained in this post are my personal opinions and unless otherwise
>stated not those of any organisation I am associated with.
>----------------------------------------------------------------------------
>----------
>Patrick Dunford, ChristChurch, NZ
>http://patrick.dunford.com/
>
>---------------------------------------------------------------------------
> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
>---------------------------------------------------------------------------
> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
>
>
>
--------------------------------------------------------------
Edward Tianjun Huang Today Software Limited
97 Great South Road
Email: [EMAIL PROTECTED] (Company) Remuera
[EMAIL PROTECTED] (Private) Auckland
--------------------------------------------------------------
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz