Date
Provides date and time functionality
today := System.Time.Date->New();
today->GetDateString()->PrintLine(); # e.g. 2026-05-23
today->GetTimeString(true)->PrintLine(); # 24-hr timeOperations
- 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) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| value | Int | days to add |
Example
d := System.Time.Date->New();
d->AddDays(7);
d->GetDateString()->PrintLine(); # one week from todayAddHours #
Add hours to the date
method : public : AddHours(value:Int) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| value | Int | hours to add |
Example
d := System.Time.Date->New();
d->AddHours(24);
d->GetDateString()->PrintLine(); # tomorrowAddMinutes #
Add minutes to the date
method : public : AddMinutes(value:Int) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| value | Int | minutes to add |
AddSeconds #
Add seconds to the date
method : public : AddSeconds(value:Int) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| value | Int | seconds to add |
Clone #
Clones the object instance
method : public : Clone() ~ System.Time.DateReturn
| Type | Description |
|---|---|
| Date | cloned the object instance |
Compare #
Compares two dates
method : public : Compare(rhs:System.Compare) ~ IntParameters
| 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() ~ StringReturn
| Type | Description |
|---|---|
| String | date string |
Example
d := System.Time.Date->New();
d->GetDateString()->PrintLine(); # 2026-05-23GetDay #
Returns the day
method : public : GetDay() ~ IntReturn
| Type | Description |
|---|---|
| Int | day |
Example
d := System.Time.Date->New();
"Date: {$d->GetMonth()}/{$d->GetDay()}/{$d->GetYear()}"->PrintLine();GetHours #
Returns the hours
method : public : GetHours() ~ IntReturn
| Type | Description |
|---|---|
| Int | hours |
Example
System.Time.Date->New()->GetHours()->PrintLine();GetMinutes #
Returns the minutes
method : public : GetMinutes() ~ IntReturn
| Type | Description |
|---|---|
| Int | minutes |
Example
System.Time.Date->New()->GetMinutes()->PrintLine();GetMonth #
Returns the month
method : public : GetMonth() ~ IntReturn
| Type | Description |
|---|---|
| Int | 1-12 month value |
Example
System.Time.Date->New()->GetMonth()->PrintLine();GetMonthName #
Returns name of the month
method : public : GetMonthName() ~ StringReturn
| Type | Description |
|---|---|
| String | name of the month |
GetSeconds #
Returns the seconds
method : public : GetSeconds() ~ IntReturn
| Type | Description |
|---|---|
| Int | seconds |
Example
System.Time.Date->New()->GetSeconds()->PrintLine();GetTimeString #
Gets the time string
method : public : GetTimeString(is_24hr:Bool) ~ StringParameters
| Name | Type | Description |
|---|---|---|
| is_24hr | Bool | true if 24-hour clock, false otherwise |
Return
| Type | Description |
|---|---|
| String | time string |
Example
d := System.Time.Date->New();
d->GetTimeString(false)->PrintLine(); # 3:45 PM
d->GetTimeString(true)->PrintLine(); # 15:45GetUnixTime #
Get the Unix time, number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC
method : public : GetUnixTime() ~ IntGetWeekDay #
Returns day of the week
method : public : GetWeekDay() ~ IntReturn
| Type | Description |
|---|---|
| Int | 0-6 day value |
GetWeekDayName #
Returns name of the week day
method : public : GetWeekDayName() ~ StringReturn
| Type | Description |
|---|---|
| String | name of the week day |
GetYear #
Returns the year
method : public : GetYear() ~ IntReturn
| Type | Description |
|---|---|
| Int | year |
Example
System.Time.Date->New()->GetYear()->PrintLine();HashID #
Returns a hash ID for the given class
method : public : HashID() ~ IntReturn
| Type | Description |
|---|---|
| Int | hash ID |
IsDaylightSaving #
Returns rather time is daylight savings
method : public : IsDaylightSaving() ~ BoolReturn
| Type | Description |
|---|---|
| Bool | true if daylight savings, false otherwise |
IsGmt #
Returns rather time is GMT
method : public : IsGmt() ~ BoolReturn
| Type | Description |
|---|---|
| Bool | true if GMT, false otherwise |
New # constructor
Constructor
New(gmt:Bool)Parameters
| Name | Type | Description |
|---|---|---|
| gmt | Bool | true of time is in GMT, false for local time zone |
New # constructor
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
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
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 |