Date and time
Previous  Next

A date/time value is represented as a string or as a number, but must respect the correct format specification.

Examples of valid date/time strings:

'2006-10-16'
'12:31'
'2006-10-16 12:31'
'2006-10-16 12:31:22'
1160994791

The first example is a valid DATE value, the second is a valid TIME value and the third, fourth are valid DATETIME values. The fifth value, 1160994791, is a valid TIMESTAMP value and corresponds to a 32bit (or 64bit, architecture dependant) unsigned integer value.

Formatting

It is suggested to use the TIMESTAMP data type to store date/time values, and to use PHP functions like strftime() to convert the value at run-time.

Note: Gladius DB does not support date/time handling predicates