PixelLightAPI
.
|
#include <Time.h>
Public Types | |
enum | EMonth { January = 1, February, March, April, May, June, July, August, September, October, November, December } |
Month of year enumeration. More... | |
enum | EDay { Sunday = 0, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday } |
Day of week enumeration. More... | |
Public Member Functions | |
PLCORE_API | Time () |
Constructor. | |
PLCORE_API | Time (uint16 nYear, EMonth nMonth, uint8 nDayOfMonth, EDay nDayOfWeek, uint8 nHour, uint8 nMinute, uint8 nSecond, uint16 nMillisecond) |
Constructor. | |
~Time () | |
Destructor. | |
uint16 | GetYear () const |
Get the year. | |
void | SetYear (uint16 nYear) |
Set the year. | |
EMonth | GetMonth () const |
Get the month. | |
void | SetMonth (EMonth nMonth) |
Set the month. | |
uint8 | GetDayOfMonth () const |
Get the day of the month. | |
void | SetDayOfMonth (uint8 nDayOfMonth) |
Set the day of the month. | |
EDay | GetDayOfWeek () const |
Get the day of the week. | |
void | SetDayOfWeek (EDay nDayOfWeek) |
Set the day of the week. | |
uint8 | GetHour () const |
Get the hour. | |
void | SetHour (uint8 nHour) |
Set the hour. | |
uint8 | GetMinute () const |
Get the minute. | |
void | SetMinute (uint8 nMinute) |
Set the minute. | |
uint8 | GetSecond () const |
Get the second. | |
void | SetSecond (uint8 nSecond) |
Set the second. | |
uint16 | GetMillisecond () const |
Get the millisecond. | |
void | SetMillisecond (uint16 nMillisecond) |
Set the millisecond. | |
PLCORE_API String | ToString () const |
Returns a string representation of the time. | |
PLCORE_API void | FromString (const String &sString) |
Set time from string representation. | |
PLCORE_API void | SetUnixDate (uint32 nUnixDate) |
Converts a date from Unix/POSIX format. | |
PLCORE_API void | SetDOSDate (uint32 nDOSDate) |
Converts a date from DOS format. | |
PLCORE_API bool | operator== (const Time &cTime) const |
PLCORE_API bool | operator!= (const Time &cTime) const |
Static Public Member Functions | |
static PLCORE_API bool | IsLeapYear (uint32 nYear) |
Returns whether or not the given year is a leap year. | |
static PLCORE_API uint8 | GetDaysPerMonth (EMonth nMonth, uint32 nYear=0) |
Returns the number of days in a month. | |
static PLCORE_API EDay | CalculateDayOfWeek (uint8 nDayOfMonth, EMonth nMonth, uint16 nYear) |
Calculates the day of a week. | |
Static Public Attributes | |
static PLCORE_API const Time | Null |
static PLCORE_API const Time | UnixEpochStart |
static PLCORE_API const Time | DOSEpochStart |
static PLCORE_API const String | ShortMonthName [12] |
static PLCORE_API const String | ShortDayName [7] |
Time and date class.
enum PLCore::Time::EMonth |
enum PLCore::Time::EDay |
PLCORE_API PLCore::Time::Time | ( | ) |
PLCORE_API PLCore::Time::Time | ( | uint16 | nYear, |
EMonth | nMonth, | ||
uint8 | nDayOfMonth, | ||
EDay | nDayOfWeek, | ||
uint8 | nHour, | ||
uint8 | nMinute, | ||
uint8 | nSecond, | ||
uint16 | nMillisecond | ||
) |
[in] | nYear | Year |
[in] | nMonth | Month [January..December] |
[in] | nDayOfMonth | Day of the month [1..31] |
[in] | nDayOfWeek | Day of the week [Sunday..Saturday] |
[in] | nHour | Hour [0..23] |
[in] | nMinute | Minute [0..59] |
[in] | nSecond | Second [0..59] |
[in] | nMillisecond | Millisecond [0..999] |
PLCore::Time::~Time | ( | ) | [inline] |
Destructor.
static PLCORE_API bool PLCore::Time::IsLeapYear | ( | uint32 | nYear | ) | [static] |
Returns whether or not the given year is a leap year.
[in] | nYear | Year to check |
static PLCORE_API uint8 PLCore::Time::GetDaysPerMonth | ( | EMonth | nMonth, |
uint32 | nYear = 0 |
||
) | [static] |
Returns the number of days in a month.
[in] | nMonth | Month to check |
[in] | nYear | Year to check (0 == ignore, and assume no leap year) |
static PLCORE_API EDay PLCore::Time::CalculateDayOfWeek | ( | uint8 | nDayOfMonth, |
EMonth | nMonth, | ||
uint16 | nYear | ||
) | [static] |
Calculates the day of a week.
[in] | nDayOfMonth | Day of month |
[in] | nMonth | Month |
[in] | nYear | Year |
uint16 PLCore::Time::GetYear | ( | ) | const [inline] |
Get the year.
void PLCore::Time::SetYear | ( | uint16 | nYear | ) | [inline] |
Set the year.
[in] | nYear | Year |
Time::EMonth PLCore::Time::GetMonth | ( | ) | const [inline] |
Get the month.
void PLCore::Time::SetMonth | ( | EMonth | nMonth | ) | [inline] |
Set the month.
[in] | nMonth | Month [January..December] |
uint8 PLCore::Time::GetDayOfMonth | ( | ) | const [inline] |
Get the day of the month.
void PLCore::Time::SetDayOfMonth | ( | uint8 | nDayOfMonth | ) | [inline] |
Set the day of the month.
[in] | nDayOfMonth | Day of the month [1..31] |
Time::EDay PLCore::Time::GetDayOfWeek | ( | ) | const [inline] |
Get the day of the week.
void PLCore::Time::SetDayOfWeek | ( | EDay | nDayOfWeek | ) | [inline] |
Set the day of the week.
[in] | nDayOfWeek | Day of the week [Sunday..Saturday] |
uint8 PLCore::Time::GetHour | ( | ) | const [inline] |
Get the hour.
void PLCore::Time::SetHour | ( | uint8 | nHour | ) | [inline] |
Set the hour.
[in] | nHour | Hour [0..23] |
uint8 PLCore::Time::GetMinute | ( | ) | const [inline] |
Get the minute.
void PLCore::Time::SetMinute | ( | uint8 | nMinute | ) | [inline] |
Set the minute.
[in] | nMinute | Minute [0..59] |
uint8 PLCore::Time::GetSecond | ( | ) | const [inline] |
Get the second.
void PLCore::Time::SetSecond | ( | uint8 | nSecond | ) | [inline] |
Set the second.
[in] | nSecond | Second [0..59] |
uint16 PLCore::Time::GetMillisecond | ( | ) | const [inline] |
Get the millisecond.
void PLCore::Time::SetMillisecond | ( | uint16 | nMillisecond | ) | [inline] |
Set the millisecond.
[in] | nMillisecond | Millisecond [0..999] |
PLCORE_API String PLCore::Time::ToString | ( | ) | const |
Returns a string representation of the time.
PLCORE_API void PLCore::Time::FromString | ( | const String & | sString | ) |
Set time from string representation.
[in] | sString | String representation (for example: Sun Sep 16 01:03:52 1973) |
PLCORE_API void PLCore::Time::SetUnixDate | ( | uint32 | nUnixDate | ) |
Converts a date from Unix/POSIX format.
[in] | nUnixDate | Date in Unix format |
PLCORE_API void PLCore::Time::SetDOSDate | ( | uint32 | nDOSDate | ) |
Converts a date from DOS format.
[in] | nDOSDate | Date in DOS format |
PLCORE_API bool PLCore::Time::operator== | ( | const Time & | cTime | ) | const |
PLCORE_API bool PLCore::Time::operator!= | ( | const Time & | cTime | ) | const |
PLCORE_API const Time PLCore::Time::Null [static] |
Year=0 Month=January Day=1 DayOfWeek=Sunday Hour=0 Minute=0 Second=0 Millisecond=0
PLCORE_API const Time PLCore::Time::UnixEpochStart [static] |
Year=1970 Month=January Day=1 DayOfWeek=Thursday Hour=0 Minute=0 Second=0 Millisecond=0
PLCORE_API const Time PLCore::Time::DOSEpochStart [static] |
Year=1980 Month=January Day=1 DayOfWeek=Tuesday Hour=0 Minute=0 Second=0 Millisecond=0
PLCORE_API const String PLCore::Time::ShortMonthName[12] [static] |
Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec
PLCORE_API const String PLCore::Time::ShortDayName[7] [static] |
Sun, Mon, Tue, Wed, Thu, Fri, Sat
|