SQL/MP Reference Manual

HP NonStop SQL/MP Reference Manual—523352-013
J-4
JULIANTIMESTAMP Function
JULIANTIMESTAMP Function
JULIANTIMESTAMP is a function that converts a date-time value into a 64-bit Julian
timestamp that represents the number of microseconds that have elapsed between
4713 B.C., January 1, 00:00 and the specified date-time value.
JULIANTIMESTAMP returns a value of type LARGEINT. You can use
JULIANTIMESTAMP anywhere SQL allows a numeric expression.
date-time-expression
is an expression that evaluates to a value of type DATETIME, DATE, TIME, or
TIMESTAMP.
If date-time-expression does not contain all the fields from YEAR through
FRACTION, SQL extends the value (using the EXTEND function rules) before
converting it to a Julian timestamp.
Example—JULIANTIMESTAMP
This example converts a date-time value into a Julian-timestamp representation of the
value. (If START_DATE is 1988-02-21:20:30, the resulting Julian timestamp would be
211439233800000000.)
SELECT JULIANTIMESTAMP ( START_DATE ) FROM PROJECTS
WHERE PROJECT_NAME = "920";
JULIANTIMESTAMP ( date-time-expression )