Firebird 2.0
PSQL Reference
Manual

DATE/TIME DATATYPES

Purpose

Use the date and time types to hold dates, times and timestamps.

Syntax

<datetime_type>
     DATE
   | TIME
   | TIMESTAMP


Semantics

Firebird supports three different date/time datatypes:

  • DATE stores a date as a 32-bit longword. Valid dates are from January 1, 100 a.d. to February 29, 32768 a.d.

  • TIME stores time as a 32-bit longword. Valid times are from 00:00 to 23:59.9999.

  • TIMESTAMP is stored as two 32-bit longwords and is a combination of DATE and TIME.

Firebird always stores the full year value in a DATE or TIMESTAMP column, never a two-digit abbreviated value. When a client application enters a two-digit year value, Firebird uses the “sliding window” algorithm to make an inference about the century:

compare the two-digit year number entered to the current year modulo 100 If the absolute difference is greater than 50, then infer that the century of the number entered is 20, otherwise it is 19.

Examples

The below example declares a variable 'birthdate' of type DATE:

DECLATE birthdate DATE;


See also

N/A


previous page goto index next page

Legal information