Public Types | |
enum | TimeInterval { min = 0, SECOND = 1000, MINUTE = SECOND * 60, HOUR = MINUTE * 60, DAY = HOUR * 24, max = DAY + SECOND - 1 } |
Constants representing measures of time. More... | |
Public Member Functions | |
string | format (cstring formatString) |
Formats this time according to a format string. | |
Properties | |
int | localMillis () |
The time in milliseconds from midnight in local time. | |
int | localMillis (int ms) |
The time in milliseconds from midnight in local time. | |
int | hour () |
int | minute () |
int | second () |
int | millisecond () |
int | localDayOffset () |
Returns the offset of the local time calendar date from the UTC date. | |
string | toString () |
Returns a string representation of this time. | |
char[] | toFormatString (uint flags) |
Formats this time according to the OS-defined format. | |
Operators | |
TimeValue | opAdd (int i) |
Adds the given interval in milliseconds to this time. | |
TimeValue | opSub (int i) |
Subtracts the given interval in milliseconds from this time. | |
TimeInterval | opSub (TimeValue d) |
Calculates the interval in milliseconds between this time and another time. | |
TimeValue | opAddAssign (int i) |
Adds the given interval in milliseconds to this time. | |
TimeValue | opSubAssign (int i) |
Subtracts the given interval in milliseconds from this time. | |
Static Public Member Functions | |
static TimeValue | now () |
Retrieves the current system time. | |
Pseudo-constructors | |
static TimeValue | opCall (int ms) |
Constructs a TimeValue with the given UTC millisecond value. | |
static TimeValue | opCall (int hour, int minute, int second=0, int ms=0) |
Constructs a TimeValue representing the given local time. | |
static TimeValue | opCall (int hour, int minute, float second) |
Constructs a TimeValue representing the given local time. | |
Public Attributes | |
int | utcMillis = int.min |
The internal numerical representation of the time. |
Constants representing measures of time.
static TimeValue smjg.libs.util.datetime.TimeValue.opCall | ( | int | ms | ) | [static] |
Constructs a TimeValue with the given UTC millisecond value.
static TimeValue smjg.libs.util.datetime.TimeValue.opCall | ( | int | hour, | |
int | minute, | |||
int | second = 0 , |
|||
int | ms = 0 | |||
) | [static] |
Constructs a TimeValue representing the given local time.
static TimeValue smjg.libs.util.datetime.TimeValue.opCall | ( | int | hour, | |
int | minute, | |||
float | second | |||
) | [static] |
Constructs a TimeValue representing the given local time.
static TimeValue smjg.libs.util.datetime.TimeValue.now | ( | ) | [static] |
string smjg.libs.util.datetime.TimeValue.format | ( | cstring | formatString | ) |
Formats this time according to a format string.
formatString | the format string, as defined in smjg.libs.util.datetimeformat. |
DateTimeFormatException | if the formatting fails, e.g. because of an error in the format string. |
int smjg.libs.util.datetime.TimeValue.localMillis | ( | ) |
The time in milliseconds from midnight in local time.
int smjg.libs.util.datetime.TimeValue.localMillis | ( | int | ms | ) |
The time in milliseconds from midnight in local time.
int smjg.libs.util.datetime.TimeValue.hour | ( | ) |
int smjg.libs.util.datetime.TimeValue.minute | ( | ) |
int smjg.libs.util.datetime.TimeValue.second | ( | ) |
int smjg.libs.util.datetime.TimeValue.millisecond | ( | ) |
int smjg.libs.util.datetime.TimeValue.localDayOffset | ( | ) |
Returns the offset of the local time calendar date from the UTC date.
-1 | local date is the day before UTC date, e.g. 01:00 UTC when the time zone is UTC-02:00. | |
0 | local date equals UTC date. | |
1 | local date is the day after UTC date, e.g. 23:00 UTC when the time zone is UTC+02:00. |
string smjg.libs.util.datetime.TimeValue.toString | ( | ) |
Returns a string representation of this time.
char [] smjg.libs.util.datetime.TimeValue.toFormatString | ( | uint | flags | ) |
Formats this time according to the OS-defined format.
flags | a value to pass to the OS time-formatting API determining how to format the time. |
TimeValue smjg.libs.util.datetime.TimeValue.opAdd | ( | int | i | ) |
Adds the given interval in milliseconds to this time.
TimeValue smjg.libs.util.datetime.TimeValue.opSub | ( | int | i | ) |
Subtracts the given interval in milliseconds from this time.
TimeInterval smjg.libs.util.datetime.TimeValue.opSub | ( | TimeValue | d | ) |
Calculates the interval in milliseconds between this time and another time.
TimeValue smjg.libs.util.datetime.TimeValue.opAddAssign | ( | int | i | ) |
Adds the given interval in milliseconds to this time.
TimeValue smjg.libs.util.datetime.TimeValue.opSubAssign | ( | int | i | ) |
Subtracts the given interval in milliseconds from this time.
int smjg.libs.util.datetime.TimeValue.utcMillis = int.min |
The internal numerical representation of the time.
This value is in milliseconds from 00:00 UTC. It must be in the range 0..86401000 or be int.min, representing an invalid or null time.