SQL/MX Report Writer Guide
Customizing a Report
HP NonStop SQL/MX Report Writer Guide—527194-002
4-43
Julian Timestamp Formats
You might also store a date as a numeric value but not as a timestamp. See Formats
for Dates Stored as Binary Values on page 4-46.
Julian Timestamp Formats
By using the AS DATE/TIME clause, you can specify the date format and time format
of a Julian timestamp.
To specify a page title that includes the local date and time, enter:
S> PAGE TITLE 'Supplier Parts Summary', TAB 30,
+> CURRENT_TIMESTAMP AS DATE * TIME *;
S> LIST NEXT 1;
Supplier Parts Summary 02/24/87 09:43:04 PM
. .
. .
By default, the date and time are printed in these formats: M2/D2/Y2 and HP2:M2:S2.
You can change the default date and time formats for your MXCI session by setting the
DATE_FORMAT and TIME_FORMAT style options as:
>> SET STYLE DATE_FORMAT 'MA3 D2, Y4',
+> TIME_FORMAT 'HB 'hours' MB2 'minutes'';
The new default date format produces Feb 24, 2002, and the new default time format
produces 21 hours 44 minutes.
To print the time before the date, enter:
AS TIME * DATE *
If you want only the date or only the time printed, you can omit the unwanted option.
To override the default date format, specify a date format in the AS DATE/TIME clause
of a report command:
S> PAGE TITLE 'Supplier Parts Summary', TAB 30,
+> CURRENT_TIMESTAMP AS DATE 'Y4 MA3 D2';
S> LIST NEXT 1;
Supplier Parts Summary 2000 FEB 24
To override the default time format, specify a time format in the AS DATE/TIME clause.
For example, the following AS TIME clause specifies a format in local civil time:
S> REPORT FOOTING 'Report completed at ',
+> CURRENT_TIMESTAMP AS TIME 'HP2:M2' IN LCT;
S> LIST ALL;
. .
. .
Report completed at 02:14 AM