DATETIME

 

DATETIME data type stores the data about the specified moment in time, as well as the DATE data type, but it includes also the time of day values besides the date. You can specify the precision of the date and time value to be used: the range may vary from year through a fraction of a second. The DATETIME values are stored as fixed-point DECIMAL numbers.

 

DATETIME data type has the following structure, which is used in the data type definition:

 

 

Element

Description

DATETIME Qualifier

Specifies the precision and scale of a DATETIME value.

 

The system environment variable GL_DATETIME can specify a wider range of formats than the DBDATETIME variable can. E.g. In some East Asian locales, it can make DATETIME data type accept and display Taiwanese or Japanese eras. In other locales it can also specify non-default display formats for DATETIME values.

 

util.Datetime class provides a set of methods that can be used with variables of DATETIME data type:

util.Datetime.format()

util.Datetime.parse()

util.Datetime.toUTC()

util.Datetime.toLocalTime()

util.Datetime.getCurrentAsUTC()

util.Datetime.getCurrentAsLocal()

util.Datetime.fromSecondsSinceEpoch()

util.Datetime.toSecondsSinceEpoch()