The eXtremeDB
datetimetype is a 64-bit integer value used to store the date and time in databases. The precision ofdatetimevalues is determined by the runtime parameterDATETIME_PRECISION. Numerically, the precision represents the number of ticks per second. The default value forDATETIME_PRECISIONis 1, which means that the database stores adatetimevalue as the number of seconds since the EPOCH (i.e. 00:00:00 UTC 1 January 1970). The resolution ofdatetimefields can be changed by an application at runtime to a resolution ranging from 1 (to store the number of seconds) to 1000000000 (for the number of nanoseconds). (However, note that the Java Date type uses millisecond resolution and the C# Datetime uses 100-nanosecond resolution. So these limitations apply to the database values possible with these native language APIs.)
It is important to note that the value of
DATETIME_PRECISIONis a per-process parameter; all processes working with the same database must set the same value forDATETIME_PRECISION. Respectively, all databases accessed from a given process will have the same precision.Arithmetic on Date, Time and Datetime Fields
When using
date,timeordatetimefields in SQL, if any operand of the arithmetic expression is of typedate,timeordatetime, then the other operand is converted todatetimeand the result of expression is of typedatetime. The result will be formatted for output depending on the original type. So, for example adatefielddaycould be incrementedday+5and the result will be of typedate.However, note that outside SQL,
dateandtimefields areuint4values, whiledatetimefields areuint8. There are no special "operations" defined for these fields. The above rule is applicable to SQL only.
Native Language APIs
The APIs for managing date, time and datetime fields are specific to the programming language used. Please use the links below to view detailed explanations and examples for your development environment:
SQL Managing date, timeanddatetimefields in SQLC Managing date, timeanddatetimefields in CC++ Managing date, timeanddatetimefields in C++Java Managing D atefields in JavaPython Managing fields in PythondatetimeC# Managing Datetimefields in C#