Classes | |
| struct | DateValue |
| The smjg.libs.util.datetime.DateValue structure represents a calendar date. More... | |
| struct | TimeValue |
| The smjg.libs.util.datetime.TimeValue structure represents a time within a day. More... | |
| struct | DateTime |
| The smjg.libs.util.datetime.DateTime structure represents a combination of date and time. More... | |
| struct | DateTimeInterval |
| The smjg.libs.util.datetime.DateTimeInterval structure represents an interval in both date and time. More... | |
| class | DateTimeException |
| The smjg.libs.util.datetime.DateTimeException class is an exception thrown when a date/time operation fails, e.g. More... | |
| struct | DateTimeComponents |
| The smjg.libs.util.datetime.DateTimeComponents structure represents a date and time in structured form. More... | |
Typedefs | |
| typedef int | DateInterval |
| The smjg.libs.util.datetime.DateInterval type represents an interval between date values, specified in days. | |
| typedef int | TimeInterval |
| The smjg.libs.util.datetime.TimeInterval type represents an interval between time values, specified in milliseconds. | |
Enumerations | |
| enum | DAY_OF_WEEK { UNSPEC = byte.min, SUN = 0, MON, TUE, WED, THU, FRI, SAT } |
| Constants representing the days of the week. More... | |
| enum | MONTH { UNSPEC = byte.min, JAN = 1, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC } |
| Constants representing the months of the year. More... | |
Functions | |
| bool | isLeapYear (int year) |
| Determines whether the given year is a leap year. | |
| int | GetDateFormatA (uint Locale, DWORD dwFlags, SYSTEMTIME *lpDate, LPCSTR lpFormat, LPSTR lpDateStr, int cchDate) |
| int | GetTimeFormatA (uint Locale, DWORD dwFlags, SYSTEMTIME *lpTime, LPCSTR lpFormat, LPSTR lpTimeStr, int cchTime) |
| int | monthLength (int month, int year) |
| Determines the length of a month. | |
| return | MONTH_OFFSET (month< 3 &&isLeapYear(year)) |
Variables | |
| const char[3][MONTH.max+1] | SHORT_DAY_NAME |
| Short (three-letter) names of the days of the week. | |
| const char[][MONTH.max+1] | LONG_DAY_NAME |
| Full names of the days of the week. | |
| const char[3][MONTH.max+1] | SHORT_MONTH_NAME |
| Short (three-letter) names of the months of the year. | |
| const char[][MONTH.max+1] | LONG_MONTH_NAME |
| Full names of the months of the year. | |
| const int | MONTH_LEN [MONTH.max+1] |
| The length of each month in a common year. | |
| int | timeZoneOffset |
| The local time zone offset from UTC in minutes. | |
| bool | allowFieldOverflow = false |
| Whether to allow alignment fields to overflow. | |
The smjg.libs.util.datetime module provides an object-oriented means of manipulating dates and times.
| typedef int smjg::libs::util::datetime.DateInterval |
The smjg.libs.util.datetime.DateInterval type represents an interval between date values, specified in days.
| typedef int smjg::libs::util::datetime.TimeInterval |
The smjg.libs.util.datetime.TimeInterval type represents an interval between time values, specified in milliseconds.
| int smjg.libs.util.datetime.GetDateFormatA | ( | uint | Locale, | |
| DWORD | dwFlags, | |||
| SYSTEMTIME * | lpDate, | |||
| LPCSTR | lpFormat, | |||
| LPSTR | lpDateStr, | |||
| int | cchDate | |||
| ) |
| int smjg.libs.util.datetime.GetTimeFormatA | ( | uint | Locale, | |
| DWORD | dwFlags, | |||
| SYSTEMTIME * | lpTime, | |||
| LPCSTR | lpFormat, | |||
| LPSTR | lpTimeStr, | |||
| int | cchTime | |||
| ) |
| bool smjg.libs.util.datetime.isLeapYear | ( | int | year | ) |
Determines whether the given year is a leap year.
| year | year to check. |
| true | if the year is a leap year. | |
| false | if the year is a common year. |
| return smjg.libs.util.datetime.MONTH_OFFSET | ( | ) |
| int smjg.libs.util.datetime.monthLength | ( | int | month, | |
| int | year | |||
| ) |
Determines the length of a month.
| month | month whose length is to be found. | |
| year | year in which the month occurs. |
| bool smjg::libs::util::datetime.allowFieldOverflow = false |
Whether to allow alignment fields to overflow.
If this is false, a DateTimeFormatException will be thrown if the formatted content of a field exceeds the field's specified width.
| const char [][MONTH.max + 1] smjg::libs::util::datetime.LONG_DAY_NAME |
Initial value:
[
DAY_OF_WEEK.SUN: "Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday"
]
| const char [][MONTH.max + 1] smjg::libs::util::datetime.LONG_MONTH_NAME |
Initial value:
[
null, MONTH.JAN: "January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
]
| const int smjg::libs::util::datetime.MONTH_LEN[MONTH.max+1] |
| const char [3][MONTH.max + 1] smjg::libs::util::datetime.SHORT_DAY_NAME |
Initial value:
[
DAY_OF_WEEK.SUN: "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
]
| const char [3][MONTH.max + 1] smjg::libs::util::datetime.SHORT_MONTH_NAME |
Initial value:
[
['\xFF', '\xFF', '\xFF'],
MONTH.JAN: "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
]
The local time zone offset from UTC in minutes.
A positive value indicates a zone ahead of UTC; a negative value behind. Under Windows, this is automatically initialised to the system time zone.
1.5.4