|
wavelength 1.0.0
|
Local date and time of the console clock. More...
#include <datetime.h>
Public Member Functions | |
| DateTime ()=default | |
| Construct a date whose fields are not set. | |
| DateTime (unsigned int nSeconds) | |
| Construct a date from a count of seconds ToSeconds() reported. | |
| bool | ReadClock () |
| Read the console clock. | |
| unsigned int | ToSeconds () const |
| Report the date as a count of seconds, with 32-day months and 384-day years from 2000. | |
| void | FormatDateTime (String &text) const |
| Write the date and time as "MM/DD/YYYY HH:MM:SS", or "DD.MM.YYYY HH:MM:SS" in the PAL build. | |
| void | FormatDate (String &text) const |
| Write the date as "MM/DD/YYYY", or "DD.MM.YYYY" in the PAL build. | |
| void | FormatMonthDay (String &text) const |
| Write the month and the day as "MM/DD", or "DD.MM" in the PAL build. | |
| void | FormatShortDate (String &text) const |
| Write the date as "MM/DD/YY", or "DD.MM.YY" in the PAL build, the year counted from 2000. | |
| bool | operator< (const DateTime &other) const |
| Report whether this date is earlier than another. | |
| unsigned char | GetSecond () const |
| void | SetSecond (unsigned char nSecond) |
| unsigned char | GetMinute () const |
| void | SetMinute (unsigned char nMinute) |
| unsigned char | GetHour () const |
| void | SetHour (unsigned char nHour) |
| unsigned char | GetDay () const |
| void | SetDay (unsigned char nDay) |
| unsigned char | GetMonth () const |
| void | SetMonth (unsigned char nMonth) |
| unsigned char | GetYear () const |
| void | SetYear (unsigned char nYear) |
| void | ToString (String &out) const |
| Write the date and time as MM/DD/YYYY hh:mm:ss. | |
Static Public Member Functions | |
| static void | PollClock () |
| Start a read of the console clock on the worker thread once 30 seconds have passed since the last read. | |
Public Attributes | |
| unsigned char | mSec |
| unsigned char | mMin |
Local date and time of the console clock.
Local calendar date and time of day, one byte per field.
The type has no RTTI, and the name is inferred. Callers clear it before ReadClock() fills it. ReadClock() returns the clock reading PollClock() last refreshed, which a task of the worker thread reads every 30 seconds.
The object is 6 bytes. The name is inferred from the routines that fill and print it.
|
default |
Construct a date whose fields are not set.
|
explicit |
Construct a date from a count of seconds ToSeconds() reported.
The name is inferred.
| nSeconds | The seconds. |
| bool DateTime::ReadClock | ( | ) |
Read the console clock.
The first call reads the clock and starts the 30-second refresh. Each field is converted from its BCD byte.
|
static |
Start a read of the console clock on the worker thread once 30 seconds have passed since the last read.
SystemPoll() calls it once per frame.
The name is inferred.
| unsigned int DateTime::ToSeconds | ( | ) | const |
Report the date as a count of seconds, with 32-day months and 384-day years from 2000.
The count orders dates but is not a calendar count.
The name is inferred.
| void DateTime::FormatDateTime | ( | String & | text | ) | const |
Write the date and time as "MM/DD/YYYY HH:MM:SS", or "DD.MM.YYYY HH:MM:SS" in the PAL build.
The name is inferred.
| text | Receives the date and time. |
| void DateTime::FormatDate | ( | String & | text | ) | const |
Write the date as "MM/DD/YYYY", or "DD.MM.YYYY" in the PAL build.
The name is inferred.
| text | Receives the date. |
| void DateTime::FormatMonthDay | ( | String & | text | ) | const |
Write the month and the day as "MM/DD", or "DD.MM" in the PAL build.
The name is inferred.
| text | Receives the month and the day. |
| void DateTime::FormatShortDate | ( | String & | text | ) | const |
Write the date as "MM/DD/YY", or "DD.MM.YY" in the PAL build, the year counted from 2000.
The name is inferred.
| text | Receives the date. |
| bool DateTime::operator< | ( | const DateTime & | other | ) | const |
Report whether this date is earlier than another.
| other | The other date. |
|
inline |
|
inline |
| nSecond | The second, 0 to 59. |
|
inline |
|
inline |
| nMinute | The minute, 0 to 59. |
|
inline |
|
inline |
| nHour | The hour, 0 to 23. |
|
inline |
|
inline |
| nDay | The day of the month, from 1. |
|
inline |
|
inline |
| nMonth | The month, from 0. |
|
inline |
|
inline |
| nYear | The years since 1900. |
| void DateTime::ToString | ( | String & | out | ) | const |
Write the date and time as MM/DD/YYYY hh:mm:ss.
| out | Receives the text. |
| unsigned char DateTime::mSec |
Seconds, 0 to 59.
| unsigned char DateTime::mMin |
Minutes, 0 to 59.