Article View: borland.public.cppbuilder.nativeapi
Article #2650Re: TDateTime
From: Robert G. Hoover
Date: Wed, 24 Jan 2007 03:23
Date: Wed, 24 Jan 2007 03:23
30 lines
1788 bytes
1788 bytes
Awesome! I guess I didn't realize I could just add a number to it! Thanks! Rob Dennis Jones wrote: > "Robert G. Hoover" <not.a.real.address@anywhere.sorry> wrote in message > news:45b6c4c7@newsgroups.borland.com... >> Is there an easy way to add time to a TDateTime object? I'd like to add an >> hour >> or a minute, etc. >> >> Thanks, >> >> Rob > > Here's a simple method: > > TDateTime dt = Now(); > printf( "\n%s", AnsiString(dt).c_str() ); // ex. print 1/23/2007 7:00:00 > PM > dt += EncodeTime(1, 0, 0, 0); > printf( "\n%s", AnsiString(dt).c_str() ); // ex. print 1/23/2007 8:00:00 > PM > > - Dennis > >
Technical Details
Message-ID:
<45b6d0fc@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<45b6c4c7@newsgroups.borland.com> <45b6cdeb@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,605f02ebdda824c7 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Tue, 23 Jan 2007 22:23:15 -0500 From: "Robert G. Hoover" <not.a.real.address@anywhere.sorry> User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: TDateTime References: <45b6c4c7@newsgroups.borland.com> <45b6cdeb@newsgroups.borland.com> In-Reply-To: <45b6cdeb@newsgroups.borland.com> X-Enigmail-Version: 0.94.1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 000706-0, 01/23/2007), Outbound message X-Antivirus-Status: Not-Tested NNTP-Posting-Host: 68.48.157.44 Message-ID: <45b6d0fc@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1169608956 68.48.157.44 (23 Jan 2007 19:22:36 -0800) Lines: 30 Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail