BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TDateTime Question

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++)
View previous topic :: View next topic  
Author Message
Cenk
Guest





PostPosted: Tue Feb 07, 2006 5:00 pm    Post subject: TDateTime Question Reply with quote



hi,

i have a date ( like 12.02.2005 13:15:00) and i wanna increase this datetime
minute by minute or second by second according to the user selection but i
could not find a way! Would you please help me? thanks
Back to top
Michael Gillen
Guest





PostPosted: Tue Feb 07, 2006 5:00 pm    Post subject: Re: TDateTime Question Reply with quote



Cenk wrote:

Quote:
hi,

i have a date ( like 12.02.2005 13:15:00) and i wanna increase this datetime minute by minute or
second by second according to the user selection but i could not find a way! Would you please
help me? thanks

#include <DateUtils.hpp>

IncDay
IncHour
IncMilliSecond
IncMinute
IncMonth
IncSecond
IncWeek
IncYear

--
-Michael Gillen
Back to top
Cenk
Guest





PostPosted: Tue Feb 07, 2006 6:00 pm    Post subject: Unable to open include file? Reply with quote



hi,

i m using BCB 5 and getting this error. How can i use this include file
<DateUtils.hpp> ?

thanks
Back to top
Pete Fraser
Guest





PostPosted: Tue Feb 07, 2006 6:00 pm    Post subject: Re: Unable to open include file? Reply with quote

Make sure that it's in your include path - Options - Directories.
HTH Pete

"Cenk" <cenk1536 (AT) yahoo (DOT) com> wrote in message
news:43e8dba5 (AT) newsgroups (DOT) borland.com...
Quote:
hi,

i m using BCB 5 and getting this error. How can i use this include file
DateUtils.hpp> ?
Back to top
Cenk
Guest





PostPosted: Tue Feb 07, 2006 7:00 pm    Post subject: How to include there? Reply with quote

hi,

how to include DateUtils.hpp there???
Back to top
Jonathan Benedicto
Guest





PostPosted: Tue Feb 07, 2006 7:00 pm    Post subject: Re: Unable to open include file? Reply with quote

Cenk wrote:
Quote:
i m using BCB 5 and getting this error. How can i use this include file
DateUtils.hpp> ?

AFAIK, BCB5 doesn't have those functions. Try this method instead:

// Untested
void __fastcall IncSecond( TDateTime &dt, int NumberOfSeconds )
{
double d = dt;
d += ((double)NumberOfSeconds / 3600.0f / 24.0f );
dt = d;
}

void __fastcall IncMinute( TDateTime &dt, int NumberOfMinutes )
{
double d = dt;
d += ((double)NumberOfMinutes / 60.0f / 24.0f );
dt = d;
}
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Tue Feb 07, 2006 7:00 pm    Post subject: Re: Unable to open include file? Reply with quote

"Cenk" <cenk1536 (AT) yahoo (DOT) com> wrote in message
news:43e8dba5 (AT) newsgroups (DOT) borland.com...

Quote:
i m using BCB 5 and getting this error. How can i use
this include file <DateUtils.hpp> ?

The DateUtils unit does not exist in BCB 5. It was introduced in BCB 6.

In BCB 5, you will have to increment TDateTime manually, ie:

TDateTime __fastcall IncSecond(const TDateTime &AValue, const __int64
ANumberOfSeconds = 1)
{
return ( ( ( ((double)AValue) * 86400 ) + ANumberOfSeconds ) /
86400 );
}

TDateTime __fastcall IncMinute(const TDateTime &AValue, const __int64
ANumberOfMinutes = 1)
{
return ( ( ( ((double)AValue) * 1440 ) + ANumberOfMinutes ) /
1440 );
}


Gambit
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.