Conversions.
Written by VR Saturday, 02 April 2011 19:12
DB2 includes a number of scalar builtin functions for performing explicit conversions involving date/time data.
Extraction of Date/Time Components
YEAR, MONTH, DAY: Convert the year or month or day portion of a specified date or timestamp or date duration or timestamp duration to a binary integer.
HOUR, MINUTE, SECOND: Convert the hours or minutes or seconds portion of a specified time or timestamp or time duration or timestamp duration to a binary integer.
MICROSECOND: Converts the microsecond portion of a specified timestamp or time stamp duration to a binary integer.
Conversion To/From Other Data Types
DATE, TIME, TIMESTAMP: Convert a specified scalar value to a date or time or timestamp. In the case of TIMESTAMP the scalar value can be specified as a pair of values, representing a date and a time respectively.
CHAR: Converts a specified date/time value to its character string representation in USA, EUR,ISO,JIS or LOCAL format.
DAYS: Converts a specified date or timestamp to a binary integer, representing the number of days since December 31st ,1 B.C.
| < Prev | Next > |
|---|