|
|
NM callable only.
Converts the dates from one supported format to another.
Syntax
I32V * I32V *
HPDATECONVERT (inputcode, inputdate, outputcode, outputdate,
I32 I32V
status, cutoff);
Parameters
- inputcode
is a 32-bit signed integer by value.
The value should be one of the date type codes listed in the table,
"Supported Date Formats."
- inputdate
varies for type by reference.
The interpretation depends upon the value of inputcode. See the table,
"Supported Date Formats," for the supported date codes and their
layouts.
- outputcode
is a 32-bit signed integer by value
The value should be one of the date type codes listed in the table,
"Supported Date Formats."
- outputdate
returns the date as per the format chosen by the outputcode
parameter
See the table "Supported Date Formats" for the supported datecodes and
their layouts.
- status
is a 32-bit signed integer by reference
An HPE STATUS parameter through which the error codes are returned.
A value of 0 indicates no error and no warnings.
- cutoff
is a 32-bit signed integer by value (optional)
This is used in validating the input parameter when the input date
hastwo-digit year. This is a required parameter for dates with two-digit
years. In all other cases, this parameter is ignored.
If the cutoff parameter is given as -1, the value of the CI environment
variable HPSPLITYEAR is used as the cutoff year.
This parameter's value should be in the range 0..100. If the value of the
parameter is 50, two digit years in the range 0..49 will translate to
2000..2049 and those in the range 50..99 will be translated to 1950..1999.
If you specify the cutoff year as 70, the mapping will be 0..69
as 2000..2069 and 70..99 as 1970..1999.
Table 7-8 Supported Date Formats
Date Type Code |
Storage Type |
#Bytes |
Explanation |
Sortable |
Y2K Ready? |
1 | longint | 8 |
MPE tune-stamp
(miroseconds since 1970-01-01) | yes | yes |
2 | integer | 4 |
Upper 2 bytes: year
next byte: month of year
bottom byte: day of month | yes | yes |
3 | integer | 4 |
Upper 2 bytes: year
bottom 2 bytes: day of year | yes | yes |
4 | integer | 4 |
Upper 23 bits: #years since 1900
bottom 9 bits: day of the year.
(analogous to the existing CALENDAR format.) | yes | yes |
10 | integer | 4 |
Seconds since 1970-01-01
(POSIX.1 time() format; valid through 2038-01-18 | yes | yes |
14 | shortint | 2 |
Upper 7 bits: #years snce 1900
Lower 9 bits: day of the year
(CALENDAR format; valid up to 2027-12-31) | yes | yes |
15 | integer | 4 |
YYMMDD date | yes | no |
16 | integer | 4 |
MMDDYY date | no | no |
17 | integer | 4 |
DDMMYY date | no | no |
18 | integer | 4 |
YYYYMMDD date | yes | yes |
25 | ASCII | 6 |
YYMMDD date | yes | no |
26 | ASCII | 6 |
MMDDYY date | no | no |
27 | ASCII | 6 |
DDMMYY date | no | no |
35 | ASCII | 6 |
YYMMDD date YY:MM3000 date1 | yes | yes |
36 | ASCII | 6 |
MMDDYY date YY:MM3000 date | no | yes |
37 | ASCII | 6 |
DDMMYY date YY:MM3000 date | no | yes |
38 | ASCII | 8 |
YYYYMMDD date | yes | yes |
Operation Notes
The date intrinsics support dates in the range 0001-01-01
through 9999-12-31. They use the Gregorian calendar for all calculations,
including the rule for leap years (even though the Gregorian calendar
was not in use prior to year 1582). This calendar also ignores the
fact that calendars in different countries changed at different
times (around the year 1753). All the "DATE" intrinsics
accept byte aligned input/output date parameters.On an error, the
intrinsics initialize the output parameters to either a binary zero
or a blank string depending on the type of the parameter.Though
the date type "4" can represent years beyond 9999,
a year beyond 9999 (which needs five digits/characters) is considered
an error.
Related Information
- Intrinsics
HPCALENDAR, HPDATEFORMAT, HPDATEDIFF, HPDATEOFFSET,
HPDATEVALIDATE, HPFMTCALENDAR
- Commands
None
- Manuals
None
|