Rogue Wave banner
Previous fileTop of documentContentsIndexNext file

Section 5: Using Class RWTime

Class RWTime represents time, stored as the number of seconds since 1 January 1901 GMT (Greenwich Meridian Time). The number of seconds that can be stored is limited by the size of a long on your system. The last date and time that can be represented with a four-byte (32-bit) long is 22:28:15 February 5, 2037 GMT.

Tools.h++ uses GMT as a synonym for UTC (Coordinated Universal Time). Note that the two time standards differ very slightly. A GMT second is a fraction of the rotation of the earth, while a UTC second is based characteristic frequencies of certain atoms.

Class RWTime uses GMT because it is a widely accepted standard, useful in calculations, but it is not the usual time reference people use in their daily lives. We tell time with a local time which may or may not observe daylight-saving time (DST) conventions; in fact, DST may or may not be in effect.

When we create an RWTime object to represent the current time, the library obtains the current GMT time directly from the operating system. However, when we create an RWTime object for some specific time, we are unlikely to do so with GMT. More likely, the time we give it will be with respect to some other time zone, and we must specify which time zone for RWTime to do its job, or even print out the time. So by default, RWTime uses a global local time, set by RWZone::local().


Previous fileTop of documentContentsIndexNext file
©Copyright 1999, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.