*
* @since 2.0
*/
- static const long long NUM_OF_TICKS_IN_DAY = 86400000;
+ static const long long NUM_OF_TICKS_IN_DAY = 86400000LL;
/**
* A constant holding the number of ticks in an hour.
*
* @since 2.0
*/
- static const long long NUM_OF_TICKS_IN_HOUR = 3600000;
+ static const long long NUM_OF_TICKS_IN_HOUR = 3600000LL;
/**
* A constant holding the number of ticks in a minute.
*
* @since 2.0
*/
- static const long long NUM_OF_TICKS_IN_MINUTE = 60000;
+ static const long long NUM_OF_TICKS_IN_MINUTE = 60000LL;
/**
* A constant holding the number of ticks in a second.
*
* @since 2.0
*/
- static const long long NUM_OF_TICKS_IN_SECOND = 1000;
+ static const long long NUM_OF_TICKS_IN_SECOND = 1000LL;
private:
//
TimeSpan::GetHours(void) const
{
long long r = __ticks % NUM_OF_TICKS_IN_DAY;
- if (r > 0)
+ if (r != 0)
{
return (long long) (r / NUM_OF_TICKS_IN_HOUR);
}
TimeSpan::GetMinutes(void) const
{
long long r = __ticks % NUM_OF_TICKS_IN_DAY;
- if (r > 0)
+ if (r != 0)
{
r = r % NUM_OF_TICKS_IN_HOUR;
- if (r > 0)
+ if (r != 0)
{
return (long long) (r / NUM_OF_TICKS_IN_MINUTE);
}
TimeSpan::GetSeconds(void) const
{
long long r = __ticks % NUM_OF_TICKS_IN_DAY;
- if (r > 0)
+ if (r != 0)
{
r = r % NUM_OF_TICKS_IN_HOUR;
- if (r > 0)
+ if (r != 0)
{
r = r % NUM_OF_TICKS_IN_MINUTE;
- if (r > 0)
+ if (r != 0)
{
return (long long) (r / NUM_OF_TICKS_IN_SECOND);
}
TimeSpan::GetMilliseconds(void) const
{
long long r = __ticks % NUM_OF_TICKS_IN_DAY;
- if (r > 0)
+ if (r != 0)
{
r = r % NUM_OF_TICKS_IN_HOUR;
- if (r > 0)
+ if (r != 0)
{
r = r % NUM_OF_TICKS_IN_MINUTE;
- if (r > 0)
+ if (r != 0)
{
r = r % NUM_OF_TICKS_IN_SECOND;
return(r);