#include <Date.h>
Inheritance diagram for Zulu:

Public Types | |
| typedef double | time_t |
Public Methods | |
| Zulu () | |
| Default constructor. | |
| Zulu (int hour, int minute, time_t second, int tz=0) | |
| Construct a Zulu from the hour, minute, and second. | |
| Zulu (time_t second, int tz=0) | |
| Construct a Zulu from the seconds since midnight. | |
| Zulu (const Zulu &z) | |
| Copy constructor. | |
| const Zulu & | operator= (const Zulu &z) |
| Copy operator. | |
| void | setTZ (int tz) |
| Set the timezone (only effects the local time). | |
| int | getTZ () const |
| Get the timezone. | |
| int | reduce () |
| Wrap time to 24 hour period. | |
| time_t | getTime (bool local=false) const |
| Get the curret time in seconds since midnight. | |
| bool | overflow () const |
| Test if the time accumulator exceeds 24 hours. | |
| int | getHour (bool local=false) const |
| Get the hour. | |
| int | getMinute () const |
| Get the minute. | |
| int | getSecond () const |
| Get the second. | |
| int | rollover () |
| Adjust the time to fit into the range 0-86400. | |
| int | addTime (time_t dt) |
| Advance the time, with 24 hour clock rollover. | |
| int | setTime (time_t t, bool local=false) |
| Set the time. | |
| void | convert (struct tm *tm, bool local=false) const |
| Extract time from a C tm structure. | |
| std::string | formatString (const char *format, bool local=false) const |
| Format the time as a string. | |
| virtual std::string | asString () const |
| Return the time as a string in the form "HH:MM::SSz". | |
| virtual std::string | typeString () const |
| Return a string representation of the type. | |
UTC or Greenwich Mean).
Times are stored as doubles in seconds since midnight. This makes time based calculations relatively easy. When the second count exceeds 86400, the day is incremented and the clock reset. Resetting the clock can cause problems with calculations involving changes in time, so care must be taken. The advantage of keeping the clock count small is that precision is not lost for small time intervals. In computing time intervals that should be small, use the SimDate::interval function.
A timezone parameter and options for operating on "local" times are provided. Care must be taken when using these methods in conjunction with dates, since the date may differ depending on whether local or zulu time is used.
|
|
|
|
|
Default constructor. Time set to midnight, Greenwich mean. |
|
||||||||||||||||||||
|
Construct a Zulu from the hour, minute, and second.
|
|
||||||||||||
|
Construct a Zulu from the seconds since midnight.
|
|
|
Copy constructor.
|
|
|
Advance the time, with 24 hour clock rollover.
|
|
|
Return the time as a string in the form "HH:MM::SSz".
|
|
||||||||||||
|
Extract time from a C tm structure.
Reimplemented in DateZulu. |
|
||||||||||||
|
Format the time as a string.
Reimplemented in DateZulu. |
|
|
Get the hour.
|
|
|
Get the minute.
|
|
|
Get the second.
|
|
|
Get the curret time in seconds since midnight.
|
|
|
Get the timezone.
|
|
|
Copy operator.
|
|
|
Test if the time accumulator exceeds 24 hours.
|
|
|
Wrap time to 24 hour period. Reduces the seconds since midnight to the range 0-86400.
|
|
|
Adjust the time to fit into the range 0-86400.
|
|
||||||||||||
|
Set the time.
|
|
|
Set the timezone (only effects the local time).
|
|
|
Return a string representation of the type.
|
|
SimData version pre-0.4.0. For more information on SimData, visit the SimData Homepage. Generated on Tue Oct 14 12:06:42 2003, using Doxygen 1.2.18. |