#include <lkdatetime.h>
Inheritance diagram for look::LookDateTime::
Public Methods | |
LookDateTime () | |
Default constructor. More... | |
LookDateTime (const LookDate &theDate, const LookTime &theTime=0) | |
Constructor. More... | |
LookDateTime (const LookDateTime &theOther) | |
Copy constructor. | |
~LookDateTime () | |
Destructor. | |
LookTypeBase* | GetNewCopy (void) const |
Get a new copy. More... | |
long | GetTypeID (void) const |
Get Type ID. More... | |
LookDateTime& | operator= (const LookDateTime &theOther) |
Assignment op. | |
bool | operator== (const LookDateTime &theOther) const |
Equal. | |
bool | operator!= (const LookDateTime &theOther) const |
Not equal. | |
bool | operator< (const LookDateTime &theOther) const |
Less than. | |
bool | operator> (const LookDateTime &theOther) const |
Greater than. | |
bool | operator<= (const LookDateTime &theOther) const |
Less than or equal. | |
bool | operator>= (const LookDateTime &theOther) const |
Greater than or equal. | |
LookDateTime& | operator+= (long theChange) |
Add seconds. | |
LookDateTime | operator+ (long theChange) const |
Add seconds. | |
long | operator- (LookDateTime &theOther) const |
Difference in seconds. More... | |
LookDateTime& | operator-= (long theChange) |
Subtract seconds. | |
LookDateTime | operator- (long theChange) const |
Subtract seconds. | |
void | SetTime (const LookTime &theTime) |
Set time. | |
void | SetDate (const LookDate &theDate) |
Set date. | |
LookTime | GetTime (void) const |
Get time. | |
LookDate | GetDate (void) const |
Get date. | |
bool | Set (const LookString &theDateTimeString) |
Set from a string. More... | |
LookString | GetString (const LookString &theDateSeparator="/", const LookString &theOrder="dmy", bool monthIsNumber=true, int yearDigits=4, const LookString &theTimeSeparator=":", int theTimePrecision=3, bool hours24=true) const |
Convert to a string. More... | |
Static Public Methods | |
LookDateTime | Now (void) |
Get current date/time (localtime). | |
Protected Methods | |
void | Normalise (void) |
Normalise date/time. More... | |
Protected Attributes | |
LookDate | itsDate |
Date. | |
LookTime | itsTime |
Time. |
This class represents a Date and a time.
It is an combination of LookDate and LookTime.
|
Default constructor. Date is initialised to unset, time to midnight. |
|
Constructor.
|
|
Get a new copy. Virtual copy constructor, aka clone.
Reimplemented from look::LookTypeBase. |
|
Convert to a string. This returns LookDate::GetString() + " " + LookTime::GetString().
|
|
Get Type ID. Pseudo-rtti, or isA.
Reimplemented from look::LookTypeBase. |
|
Normalise date/time. This is called after adding or subtracting seconds. |
|
Set from a string. This can cope with a variety of formats. See LookDateTimeReader for a more general converter. The string is split by the first space character - that portion before the space is used for LookDate::Set() and that portion after (if present) is used for LookTime::Set(). If the date portion fails, the time isn't converted. If either of these fails it returns false.
|
|
Difference in seconds. Divide by 86400 to get the difference in days. |