v2026.6.4
All Bundles
Bundle ODBC database access layer. Connection manages database sessions; Statement and ParameterStatement execute SQL queries; ResultSet iterates over rows and extracts typed column values. Compile with -lib odbc.

Date

ODBC date

Operations

GetDay #

Gets the day

method : public : GetDay() ~ Int

Return

TypeDescription
Intday

GetMonth #

Gets the month

method : public : GetMonth() ~ Int

Return

TypeDescription
Intmonth

GetYear #

Gets the year

method : public : GetYear() ~ Int

Return

TypeDescription
Intyear

New # constructor

Default constructor

New()

New # constructor

Copy constructor for System.Time.Date

New(date:System.Time.Date)

Parameters

NameTypeDescription
dateDateSystem.Time.Date

SetDay #

Sets the day

method : public : SetDay(day:Int) ~ Nil

Parameters

NameTypeDescription
dayIntvalue

SetMonth #

Sets the month

method : public : SetMonth(month:Int) ~ Nil

Parameters

NameTypeDescription
monthIntvalue

SetYear #

Sets the year

method : public : SetYear(year:Int) ~ Nil

Parameters

NameTypeDescription
yearIntvalue

ToDate #

Converts a ODBC date into a system date

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

Return

TypeDescription
Datesystem date

Example

conn := Database.ODBC.Connection->New("mydsn", "user", "pass");
rs := conn->Select("SELECT created_on FROM events");
if(rs->Next()) {
  d := rs->GetDate("created_on");
  sys_date := d->ToDate(); # convert to System.Time.Date
  sys_date->ToString()->PrintLine();
};
conn->Close();

ToString #

Creates a string representation of the date

method : public : ToString() ~ String

Return

TypeDescription
Stringstring representation of the date