The DATE, TIME and TIMESTAMP data types are used to work with data containing dates and times.
 
Time zone support is available using the types TIME WITH TIME ZONE and TIMESTAMP WITH TIME ZONE.In this language reference, we’ll use TIME and TIMESTAMP to refer both to the specific types without time zone — TIME [WITHOUT TIME ZONE] and TIMESTAMP [WITHOUT TIME ZONE] — and aspects of both the without time zone and with time zone types, which one we mean is usually clear from the context.
 
| Important | 
The data types TIME WITHOUT TIME ZONE,TIMESTAMP WITHOUT TIME ZONEandDATEare defined to use the session time zone when converting from or to aTIME WITH TIME ZONEorTIMESTAMP WITH TIME ZONE.TIMEandTIMESTAMPare synonymous to their respectiveWITHOUT TIME ZONEdata types. | 
 
Dialect 3 supports all the five types, while Dialect 1 has only DATE.The DATE type in Dialect 3 is “date-only”, whereas the Dialect 1 DATE type stores both date and time-of-day, equivalent to TIMESTAMP in Dialect 3.Dialect 1 has no “date-only” type.
 
| Note | 
Dialect 1 DATEdata can be defined alternatively asTIMESTAMPand this is recommended for new definitions in Dialect 1 databases. | 
 
Fractions of Seconds
If fractions of seconds are stored in date and time data types, Firebird stores them to ten-thousandths of a second (100 microseconds or deci-milliseconds).If a lower granularity is preferred, the fraction can be specified explicitly as thousandths, hundredths or tenths of a second, or second, in Dialect 3 databases of ODS 11 or higher.
 
| Note | Some Useful Knowledge about Sub-second Precision 
The time-part of a TIMEorTIMESTAMPis a 32-bit integer, with room for deci-milliseconds (or 100 microseconds) precision and time values are stored as the number of deci-milliseconds elapsed since midnight.The actual precision of values stored in or read from time(stamp) functions and variables is: 
CURRENT_TIMEandLOCALTIMEdefault to seconds precision and can be specified up to milliseconds precision withCURRENT_TIME({0|1|2|3})orLOCALTIME({0|1|2|3})
CURRENT_TIMESTAMPandLOCALTIMESTAMPdefault to milliseconds precision.Precision from seconds to milliseconds can be specified withCURRENT_TIMESTAMP({0|1|2|3})orLOCALTIMESTAMP({0|1|2|3})
Literal 'NOW'defaults to milliseconds precision
Functions DATEADD()andDATEDIFF()support up to deci-milliseconds precision withMILLISECOND
The EXTRACT()function returns up to deci-milliseconds precision with theSECONDandMILLISECONDarguments
the ‘+’ and ‘-’ operators work with deci-milliseconds precision. 
Deci-milliseconds precision is not supported by all drivers and access components.The best assumption to make from all this is that, although Firebird stores TIMEand theTIMESTAMPtime-part values as the number of deci-milliseconds (10-4 seconds) elapsed since midnight, the actual precision could vary from seconds to milliseconds. |