🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.nativeapi.win32
Article #32

Re: Adding time to the a tdatetime

#32
From: Pieter Zijlstra
Date: Mon, 04 Aug 2008 19:38
49 lines
2421 bytes
John Herbster wrote:

>  procedure TForm1.Button4Click(Sender: TObject);
>  var s: string; dt: TDateTime;
>  begin
>    s := FormatDateTime('yyyy-mm-dd_HH:nn:ss.zzz', 0.00);
>      Memo1.Lines.Add(s);
>    s := FormatDateTime('yyyy-mm-dd_HH:nn:ss.zzz', 2.75);
>      Memo1.Lines.Add(s);
>    s := FormatDateTime('yyyy-mm-dd_HH:nn:ss.zzz',-1.25);
>      Memo1.Lines.Add(s);
>    s := FormatDateTime('yyyy-mm-dd_HH:nn:ss.zzz',35065);
>      Memo1.Lines.Add(s);
>    dt := EncodeDateTime(1899,12,29,06,00,00,000);
>      Memo1.Lines.Add('EncodeDateTime(1899,12,29,06,00,00,000) =');
>    s := FormatDateTime(' yyyy-mm-dd_HH:nn:ss.zzz',dt);
>      Memo1.Lines.Add(s); {D7's DateUtils.EncodeDateTime has error.}
> end;

Can't remember if I already tested this one before, but here we go :)

D7
1899-12-30_00:00:00.000
1900-01-01_18:00:00.000
1899-12-29_06:00:00.000
1996-01-01_00:00:00.000
EncodeDateTime(1899,12,29,06,00,00,000) =
 1899-12-30_18:00:00.000

D2006
1899-12-30_00:00:00.000
1900-01-01_18:00:00.000
1899-12-29_06:00:00.000
1996-01-01_00:00:00.000
EncodeDateTime(1899,12,29,06,00,00,000) =
 1899-12-29_06:00:00.000

D2007
1899-12-30_00:00:00.000
1900-01-01_18:00:00.000
1899-12-29_06:00:00.000
1996-01-01_00:00:00.000
EncodeDateTime(1899,12,29,06,00,00,000) =
 1899-12-29_06:00:00.000

Seems to be fixed in the later versions.

-- 
Pieter
Technical Details
Message-ID: <xn0ftjf8abdku9j003@newsgroups.codegear.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newshub.sdsu.edu!news.linkpendium.com!news.linkpendium.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4896af50$1@newsgroups.borland.com> <4896b315$1@newsgroups.borland.com> <4896e1ef$1@newsgroups.borland.com> <48973185$1@newsgroups.borland.com> <48974bb1$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 14438e,9029b760e9d08754
X-Google-Attributes: gid14438e,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Pieter Zijlstra" <p.zylstra.notthis@hccnet.nl>
Subject: Re: Adding time to the a tdatetime
Newsgroups: borland.public.delphi.nativeapi.win32
References: <4896af50$1@newsgroups.borland.com> <4896b315$1@newsgroups.borland.com> <4896e1ef$1@newsgroups.borland.com> <48973185$1@newsgroups.borland.com> <48974bb1$1@newsgroups.borland.com>
Date: Mon, 4 Aug 2008 21:38:53 +0200
User-Agent: XanaNews/1.18.1.11
Message-ID: <xn0ftjf8abdku9j003@newsgroups.codegear.com>
X-Ref: newsgroups.codegear.com ~XNS:00000765
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 80.100.173.199
X-Trace: newsgroups.borland.com 1217878730 80.100.173.199 (4 Aug 2008 12:38:50 -0700)
Lines: 49
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newshub.sdsu.edu!news.linkpendium.com!news.linkpendium.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail