| View previous topic :: View next topic |
| Author |
Message |
Cenk Guest
|
Posted: Tue Feb 07, 2006 5:00 pm Post subject: TDateTime Question |
|
|
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
|
Posted: Tue Feb 07, 2006 5:00 pm Post subject: Re: TDateTime Question |
|
|
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
|
Posted: Tue Feb 07, 2006 6:00 pm Post subject: Unable to open include file? |
|
|
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
|
Posted: Tue Feb 07, 2006 6:00 pm Post subject: Re: Unable to open include file? |
|
|
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
|
Posted: Tue Feb 07, 2006 7:00 pm Post subject: How to include there? |
|
|
hi,
how to include DateUtils.hpp there??? |
|
| Back to top |
|
 |
Jonathan Benedicto Guest
|
Posted: Tue Feb 07, 2006 7:00 pm Post subject: Re: Unable to open include file? |
|
|
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
|
Posted: Tue Feb 07, 2006 7:00 pm Post subject: Re: Unable to open include file? |
|
|
"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 |
|
 |
|