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

Reply via email to