v2025.6.2
All Bundles

Date

Provides date and time functionality

Operations

AddDays

Add days to the date

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

Parameters

NameTypeDescription
valueIntdays to add

AddHours

Add hours to the date

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

Parameters

NameTypeDescription
valueInthours to add

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
System.Time.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

GetDay

Returns the day

method : public : GetDay() ~ Int

Return

TypeDescription
Intday

GetHours

Returns the hours

method : public : GetHours() ~ Int

Return

TypeDescription
Inthours

GetMinutes

Returns the minutes

method : public : GetMinutes() ~ Int

Return

TypeDescription
Intminutes

GetMonth

Returns the month

method : public : GetMonth() ~ Int

Return

TypeDescription
Int1-12 month value

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

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

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

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

Default constructor

New()

New

Constructor

New(gmt:Bool)

Parameters

NameTypeDescription
gmtBooltrue of time is in GMT, false for local time zone

New

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, 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

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