Date
Provides date and time functionality
Operations
- New
- AddDays
- AddHours
- AddMinutes
- AddSeconds
- Clone
- Compare
- GetDateString
- GetDay
- GetHours
- GetMinutes
- GetMonth
- GetMonthName
- GetSeconds
- GetTimeString
- GetUnixTime
- GetWeekDay
- GetWeekDayName
- GetYear
- HashID
- IsDaylightSaving
- IsGmt
- ToShortString
- ToString
AddDays
Add days to the date
method : public : AddDays(value:Int) ~ Nil
Parameters
Name | Type | Description |
---|---|---|
value | Int | days to add |
AddHours
Add hours to the date
method : public : AddHours(value:Int) ~ Nil
Parameters
Name | Type | Description |
---|---|---|
value | Int | hours to add |
AddMinutes
Add minutes to the date
method : public : AddMinutes(value:Int) ~ Nil
Parameters
Name | Type | Description |
---|---|---|
value | Int | minutes to add |
AddSeconds
Add seconds to the date
method : public : AddSeconds(value:Int) ~ Nil
Parameters
Name | Type | Description |
---|---|---|
value | Int | seconds to add |
Clone
Clones the object instance
method : public : Clone() ~ System.Time.Date
Return
Type | Description |
---|---|
System.Time.Date | cloned the object instance |
Compare
Compares two dates
method : public : Compare(rhs:System.Compare) ~ Int
Parameters
Name | Type | Description |
---|---|---|
rhs | Compare | compare date |
Return
Type | Description |
---|---|
Int | 0 if equal, -1 if right-hand side i greater, 1 if left-hand side is greater |
GetDateString
Gets the date string
method : public : GetDateString() ~ String
Return
Type | Description |
---|---|
String | date string |
GetMonthName
Returns name of the month
method : public : GetMonthName() ~ String
Return
Type | Description |
---|---|
String | name of the month |
GetTimeString
Gets the time string
method : public : GetTimeString(is_24hr:Bool) ~ String
Parameters
Name | Type | Description |
---|---|---|
is_24hr | Bool | true if 24-hour clock, false otherwise |
Return
Type | Description |
---|---|
String | time string |
GetUnixTime
Get the Unix time, number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC
method : public : GetUnixTime() ~ Int
GetWeekDay
Returns day of the week
method : public : GetWeekDay() ~ Int
Return
Type | Description |
---|---|
Int | 0-6 day value |
GetWeekDayName
Returns name of the week day
method : public : GetWeekDayName() ~ String
Return
Type | Description |
---|---|
String | name of the week day |
HashID
Returns a hash ID for the given class
method : public : HashID() ~ Int
Return
Type | Description |
---|---|
Int | hash ID |
IsDaylightSaving
Returns rather time is daylight savings
method : public : IsDaylightSaving() ~ Bool
Return
Type | Description |
---|---|
Bool | true if daylight savings, false otherwise |
IsGmt
Returns rather time is GMT
method : public : IsGmt() ~ Bool
Return
Type | Description |
---|---|
Bool | true if GMT, false otherwise |
New
Constructor
New(gmt:Bool)
Parameters
Name | Type | Description |
---|---|---|
gmt | Bool | true of time is in GMT, false for local time zone |
New
Constructor, set time using Unix time
New(unix_time:Int, gmt:Bool)
Parameters
Name | Type | Description |
---|---|---|
unix_time | Int | number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC |
gmt | Bool | true of time is in GMT, false for local time zone |
New
Constructor, sets time to midnight of the given day
New(day:Int, month:Int, year:Int, gmt:Bool)
Parameters
Name | Type | Description |
---|---|---|
day | Int | day of month |
month | Int | day of year |
year | Int | year |
gmt | Bool | true of time is in GMT, false for local time zone |
New
Constructor
New(day:Int, month:Int, year:Int, hours:Int, mins:Int, secs:Int, gmt:Bool)
Parameters
Name | Type | Description |
---|---|---|
day | Int | day of month |
month | Int | month of year |
year | Int | year |
hours | Int | hours |
mins | Int | minutes |
secs | Int | seconds |
gmt | Bool | true of time is in GMT, false for local time zone |
ToShortString
Creates a shortened string representation of the date
method : public : ToShortString() ~ String
Return
Type | Description |
---|---|
String | shortened string representation of the date |
ToString
Creates a string representation of the date
method : public : ToString() ~ String
Return
Type | Description |
---|---|
String | string representation of the date |