mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-25 10:09:36 +02:00
trunk: backport eventing from 1.4.3
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// DateTime.cpp
|
||||
//
|
||||
// $Id: //poco/svn/Foundation/src/DateTime.cpp#2 $
|
||||
// $Id: //poco/1.4/Foundation/src/DateTime.cpp#1 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: DateTime
|
||||
@@ -335,9 +335,19 @@ double DateTime::toJulianDay(int year, int month, int day, int hour, int minute,
|
||||
}
|
||||
|
||||
|
||||
void DateTime::checkLimit(short& lower, short& higher, short limit)
|
||||
{
|
||||
if (lower >= limit)
|
||||
{
|
||||
higher += short(lower / limit);
|
||||
lower = short(lower % limit);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DateTime::normalize()
|
||||
{
|
||||
checkLimit(_microsecond, _millisecond, 1000);
|
||||
checkLimit(_microsecond, _millisecond, 1000);
|
||||
checkLimit(_millisecond, _second, 1000);
|
||||
checkLimit(_second, _minute, 60);
|
||||
checkLimit(_minute, _hour, 60);
|
||||
|
||||
Reference in New Issue
Block a user