Rogue Wave Banner

Click on the banner to return to the user guide home page.

©Copyright 1996 Rogue Wave Software

Chapter 5: Using Class RWTime

Class RWTime represents time, stored as the number of seconds since 1 January 1901 UTC. UTC is sometimes called GMT, for 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 UTC.

Class RWTime uses UTC 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 UTC time directly from the operating system. However, when we create an RWTime object for some specific time, we are unlikely to do so with UTC. 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 file Table of Contents Next file