예제 #1
0
Timestamp
Timestamp::fromComponents(const Timestamp::Components &c)
{
  Components normal = c;
  normal.normalize();
  return Timestamp((c.hours * millisPerHour)
                 + (c.minutes * millisPerMinute)
                 + (c.seconds * millisPerSecond)
                 + (c.msec));
}
예제 #2
0
void
Timestamp::setComponents(const Timestamp::Components &c)
{
  Components normal = c;
  normal.normalize();
  ms = (c.hours * millisPerHour)
     + (c.minutes * millisPerMinute)
     + (c.seconds * millisPerSecond)
     + (c.msec);
}