v2026.5.3
All Bundles
Bundle Date, time, and elapsed-timer utilities. Date provides current date/time and arithmetic (AddDays, AddHours). Timer measures wall-clock elapsed time. Included in lang.obl.

Date

Provides date and time functionality

Implements: Compare, Clone, Stringify
today := System.Time.Date->New();
today->GetDateString()->PrintLine();   # e.g. 2026-05-23
today->GetTimeString(true)->PrintLine(); # 24-hr time

Operations

AddDays #

Add days to the date

method : public : AddDays(value:Int) ~ Nil

Parameters

NameTypeDescription
valueIntdays to add

Example

d := System.Time.Date->New();
d->AddDays(7);
d->GetDateString()->PrintLine();  # one week from today

AddHours #

Add hours to the date

method : public : AddHours(value:Int) ~ Nil

Parameters

NameTypeDescription
valueInthours to add

Example

d := System.Time.Date->New();
d->AddHours(24);
d->GetDateString()->PrintLine();  # tomorrow

AddMinutes #

Add minutes to the date

method : public : AddMinutes(value:Int) ~ Nil

Parameters

NameTypeDescription
valueIntminutes to add

AddSeconds #

Add seconds to the date

method : public : AddSeconds(value:Int) ~ Nil

Parameters

NameTypeDescription
valueIntseconds to add

Clone #

Clones the object instance

method : public : Clone() ~ System.Time.Date

Return

TypeDescription
Datecloned the object instance

Compare #

Compares two dates

method : public : Compare(rhs:System.Compare) ~ Int

Parameters

NameTypeDescription
rhsComparecompare date

Return

TypeDescription
Int0 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

TypeDescription
Stringdate string

Example

d := System.Time.Date->New();
d->GetDateString()->PrintLine();  # 2026-05-23

GetDay #

Returns the day

method : public : GetDay() ~ Int

Return

TypeDescription
Intday

Example

d := System.Time.Date->New();
"Date: {$d->GetMonth()}/{$d->GetDay()}/{$d->GetYear()}"->PrintLine();

GetHours #

Returns the hours

method : public : GetHours() ~ Int

Return

TypeDescription
Inthours

Example

System.Time.Date->New()->GetHours()->PrintLine();

GetMinutes #

Returns the minutes

method : public : GetMinutes() ~ Int

Return

TypeDescription
Intminutes

Example

System.Time.Date->New()->GetMinutes()->PrintLine();

GetMonth #

Returns the month

method : public : GetMonth() ~ Int

Return

TypeDescription
Int1-12 month value

Example

System.Time.Date->New()->GetMonth()->PrintLine();

GetMonthName #

Returns name of the month

method : public : GetMonthName() ~ String

Return

TypeDescription
Stringname of the month

GetSeconds #

Returns the seconds

method : public : GetSeconds() ~ Int

Return

TypeDescription
Intseconds

Example

System.Time.Date->New()->GetSeconds()->PrintLine();

GetTimeString #

Gets the time string

method : public : GetTimeString(is_24hr:Bool) ~ String

Parameters

NameTypeDescription
is_24hrBooltrue if 24-hour clock, false otherwise

Return

TypeDescription
Stringtime string

Example

d := System.Time.Date->New();
d->GetTimeString(false)->PrintLine();  # 3:45 PM
d->GetTimeString(true)->PrintLine();   # 15:45

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

TypeDescription
Int0-6 day value

GetWeekDayName #

Returns name of the week day

method : public : GetWeekDayName() ~ String

Return

TypeDescription
Stringname of the week day

GetYear #

Returns the year

method : public : GetYear() ~ Int

Return

TypeDescription
Intyear

Example

System.Time.Date->New()->GetYear()->PrintLine();

HashID #

Returns a hash ID for the given class

method : public : HashID() ~ Int

Return

TypeDescription
Inthash ID

IsDaylightSaving #

Returns rather time is daylight savings

method : public : IsDaylightSaving() ~ Bool

Return

TypeDescription
Booltrue if daylight savings, false otherwise

IsGmt #

Returns rather time is GMT

method : public : IsGmt() ~ Bool

Return

TypeDescription
Booltrue if GMT, false otherwise

New # constructor

Default constructor

New()

New # constructor

Constructor

New(gmt:Bool)

Parameters

NameTypeDescription
gmtBooltrue 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

NameTypeDescription
unix_timeIntnumber of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC
gmtBooltrue 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

NameTypeDescription
dayIntday of month
monthIntday of year
yearIntyear
gmtBooltrue 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

NameTypeDescription
dayIntday of month
monthIntmonth of year
yearIntyear
hoursInthours
minsIntminutes
secsIntseconds
gmtBooltrue of time is in GMT, false for local time zone

ToShortString #

Creates a shortened string representation of the date

method : public : ToShortString() ~ String

Return

TypeDescription
Stringshortened string representation of the date

ToString #

Creates a string representation of the date

method : public : ToString() ~ String

Return

TypeDescription
Stringstring representation of the date

Example

System.Time.Date->New()->ToString()->PrintLine();