Skip to main content

Date & Time types

JSON DB date and time types use ISO 8601 and ISO 8604 format while FairCom's other APIs use other conventions

Section

Description

DATE

DATE is a FairCom database field type containing a date value, such as "2022-03-08" and is stored in a record as an unsigned 32-bit integer that represents a specific day in the Gregorian calendar.

TIME

TIME is a FairCom database field type containing a time value, such as "15:35:02:00" and is stored in a record as a 32-bit unsigned integer that represents a specific millisecond in a day.

TIMESTAMP

TIMESTAMP is a FairCom database field type that is stored in a record as a 64-bit number that represents a specific DATE and TIME.

JSON DB date and time types

json date formatjson action date formatjsonAction date formatjson time formatjson action time formatjsonAction time formatjson datetime formatjson action datetime formatjsonAction datetime formatjson timestamp formatjson action timestamp formatjsonAction timestamp format

DATE is a FairCom database field type containing a date value, such as "2022-03-08". It is stored in a record as an unsigned 32-bit integer that represents a specific day in the Gregorian calendar. A date has three parts: year, month, and day. It does not include time or a timezone offset.

FairCom's date types include DATE, TIME, and TIMESTAMP.

DATE's behavior in different APIs:
  • In FairCom's JSON DB API, a DATE value is represented as a JSON string that contains an ISO 8601 formatted date, which uses a year-month-day format without a timezone — for example, "2023-03-16".

  • In FairCom's SQLAPI, a DATE value is submitted and returned as ASCII characters using the ODBC format {d 'YYYY-MM-DD'} — for example, {d '2023-03-16'}.

  • In FairCom's ISAM and CTDB APIs, a DATE value is submitted and returned as a binary FairCom date value. FairCom provides functions to convert a FairCom date into the date types required by other languages.

TIME is a FairCom database field type containing a time value, such as "15:35:02:00". It is stored in a record as a 32-bit unsigned integer that represents a specific millisecond in a day. A time has four parts: hour, minute, second, and millisecond which represent the number of milliseconds after midnight. It does not include a date or a timezone offset.

FairCom's date types include DATE, TIME, and TIMESTAMP.

TIME's behavior in different APIs:
  • In FairCom's JSON DB API, a TIME value is represented as a string containing an ISO8604 time without a timezone, which uses an hour:minute:second.fraction format — for example, "17:35:20.5".

  • In FairCom's SQL API, a TIME value is submitted and returned as ASCII characters in hour:minute:second.millisecond format using the ODBC format {t 'HH:MI:SS:MS'} — for example, {t '17-35-02-00'}.

  • In FairCom's ISAM and CTDB APIs, a TIME value is submitted and returned as a binary FairCom time value. FairCom provides functions to convert a FairCom time into the time types required by other languages.

TIMESTAMP is a FairCom database field type. It is stored in a record as a 64-bit number that represents a specific DATE and TIME. It does not include a timezone offset.

In FairCom's JSON DB API, a TIMESTAMP value is represented as an ISO8604 date and time without a timezone, which uses a year-month-dayThour:minute:second.fraction format, such as "2023-03-16T17:35:20.5".

FairCom's date types include DATE, TIME, and TIMESTAMP.

TIMESTAMP's behavior in different APIs:
  • In FairCom's SQL API, a TIMESTAMP value is submitted and returned year-month-day hour:minute:second.millisecond format as ASCII characters using the ODBC format {ts 'YYYY-MM-DD HH:MI:SS:MS'} — for example, {ts '2023-03-16 17-35-02-00'}.

  • In FairCom's ISAM and CTDB APIs, a TIMESTAMP value is submitted and returned as a binary FairCom timestamp value. FairCom provides functions to convert a FairCom time into the date and time types required by other languages.