These functions append the date and/or time in a specific format to the current output blob area.
Adds the current date in HL7 format YYYYMMDDHHMMSS#PPPP
where “#PPPP
” is
plus or minus hours and minutes from Greenwich Mean Time (GMT).
None.
“0844
” is
8 hours and 44 minutes from GMT.
Adds the current date in the format: DD.MM.YYYY
;
for example, “20.12.2005
”.
None.
Adds the current date in the format MMDDYY
;
for example, “032005
”.
None.
Adds the current date in the format MM/DD/YY
;
for example, “02/17/05
”.
None.
Adds the current date in the format MMDDYYYY
,
for example, “09072005
”.
None.
Adds the current date in the format YYMMDD
;
for example, “050501
”.
None.
Adds the current time in the format HHMMSS
;
for example, “231104
”.
None.
Adds the current time to current output blob area
in the format HH:MM:SS
.
None.
Calculates as an age the difference between the current date
and the date in the current blob area, and replaces
the current blob area with the result. If the
date in the current blob area is in the future,
this function returns the difference as a negative value. The date
in the current blob area must be in one of the
following formats—yymmdd
, yyyymmdd
, yy/mm/dd
,
or yyyy/mm/dd
.
Date Format – use one or more format specifiers and
any ordinary characters. Valid specifiers are %y
for
the age in years, %d
for
the remainder of the age in days (use with the %y
specifier),
and %D
for the
entire age in days.
Year 1900 Base – use this option
when both dates being passed have a 1900 base century (1900 – 1999).
For example, the two dates that are passed are 85/03/29
and 99/03/29
.
When Year 1900 Base is selected, 85
and 99
are
considered to be the years 1985 and 1999.
Year 2000 Base – use this option when both
dates being passed have a 2000 base century (2000-2999). For example,
the two dates that are passed are 01/03/29
and 05/03/29
.
When Year 2000 Base is selected, 01
and 03
are
considered to be 2001 and 2003.
Trust Current OS Base – use this option
when you want to apply the base century of the operating system
(OS) being used to the dates being passed. For example, the two
dates that are passed are 85/03/29
and 99/03/29
. When
Trust Current OS Base is selected, 85
and 99
are
considered to be 1985 and 1999 if the Current OS Base is also a
1900 base century, or 2085 and 2099 if the Current OS Base is a
2000 base century.
Window Year – use this option when you want to set a two-digit window year to be applied by the engine to determine base century of the dates passed. Enter the two-digit window year in the field next to the Window Year option. If the two-digit dates that are passed are greater than the number in the Window Year field, the engine assigns a 1900 base century. If the two-digit dates are less than or equal to that number, the engine assigns a 2000 base century.
The two-digit date in the Window Year field is “50
”.
The two dates passed are “01/01/01
” and “99/12/31
”.
The 01
and 99
are
compared to the 50
that
is in the Window Year filed, and 01
is
assigned a 2000 base (2001) because it is less than or equal to 50
,
and the 99
is assigned
a 1900 base (1999) because it is greater than 50
.
When setting the Window Year date, if you set it to a date that is low, you must increase it to before the end of the year so the engine does not revert to 1900 when the year is over.
Adds the current date and/or time to the current output blob area. Format depends on the format specifier used. All characters that are not format specifiers are copied unchanged into the output blob area in the same position as they are in the arguments.
This string consists of zero or more conversion specifications and ordinary characters. Ordinary characters, such as dashes, are copied directly into the buffer. A conversion specification consists of a percent sign and one other character.
Date Format – any format specifier that is valid
with the C function strftime(), and any ordinary
characters; for example, “%m
- %d - %y
”.
Refer to your platform and version-specific C developers
guide for the valid strftime() arguments available
to you. These arguments may vary depending on platform and OS version.
Calculates the difference between the date in the current blob and
the date specified in either the FieldObj argument or the Datalink
argument, and replaces the current blob area
with the result. The date in the current blob area must
be in one of the following formats: yymmdd
, yyyymmdd
, yy/mm/dd
,
or yyyy/mm/dd
.
If either of the dates you are passing have a base year
of 1800, you must use either the
yyyymmdd
or yyyy/mm/dd
format.
If the date specified in either the FieldObj argument or the Datalink
argument is earlier, chronologically, than the current blob,
the result is a negative number.
Format – enter the output format:
%Y – years between
two dates, without limitation to a 365 day year. For example, the
two dates passed are 00/01/01
and 01/01/01
, with
a format argument of %Y
.
The output would be 1
,
even though the year 2000 actually has 366 days.
%y – total days between the two
dates, divided by 365. For example, The two dates passed are 00/01/01
and 01/01/01
,
with a format argument of %y
.
The output would be 1
,
even though the year 2000 actually has 366 days.
%D – total days between the two
dates. For example, the two dates passed are 00/01/01
and 01/01/01
,
with a format argument of %D
. The
output would be 366
, because
the year 2000 is a leap year and has 366 days.
FieldObj – enter a date.
Datalink – enter a date.
With a Format argument field of:
%D, %Y, %y, %r
a datalink date of “01/01/01
”,
and a current blob date of “00/01/01
”, the
output is:
366,1,0,1,1
With a Format argument field of:
%D, %Y, %y, %r
a current blob date of “01/01/01
”,
and a datalink date of “00/01/01
”, the
output is:
-366,-1,0,-1,-1
Converts from an input date format to an output date format. The format of the incoming data can be described by a field object, a datalink, or a literal. The fields are mutually exclusive. If no field object is specified, the datalink is used; if no datalink is specified, the literal is used.
The format of the incoming date is specified using any number of these characters and any other ordinary characters:
Character |
Description |
---|---|
D |
Day of the month. |
M |
Month of the year. |
Y |
Year. |
J |
Julian date (1-366). |
j |
Julian date (0-365). |
W |
Day of the week, starting Sunday (1-7). |
w |
Day of the week, starting Sunday (0-6). |
The output format must be described by a literal, using C
date-formatting specifiers. YYJJJ
formats
use a century value based on the option button selected in the Filter
Information window. In the Filter Information window you can select
a 1900 or 2000 year base. You can also trust the current OS base.
In FieldObj – the name of a field object containing the date format.
In Datalink – the name of a datalink object containing the date format.
In Literal – a format specifier using the letters above, and any ordinary characters.
Out – any format specifier that is valid with the C function strftime(), and any ordinary characters.
When In Literal is “MMDDYY
” (as
in 123197) and Out is “%m
- %d - %y
”, the result
becomes “12 - 31 - 97
”.
Refer to your platform and version-specific C developers
guide for the valid strftime() arguments available
to you. These arguments may vary depending on platform and OS version.
Converts the incoming data from a Gregorian format (YYMMDD
or YYYYMMDD
) to
the format indicated by the arguments and places it into the current
output blob area.
Date Format – any format specifier that is valid with the C function strftime() and any ordinary characters.
Year 1900 Base – use this option
when both dates being passed have a 1900 base century (1900 – 1999).
For example, the two dates that are passed are 85/03/29
and 99/03/29
.
When Year 1900 Base is selected, 85
and 99
are
considered to be the years 1985 and 1999.
Year 2000 Base – use this option when both
dates being passed have a 2000 base century (2000-2999). For example,
the two dates that are passed are 01/03/29
and 05/03/29
.
When Year 2000 Base is selected, 01
and 03
are
considered to be 2001 and 2003.
Trust Current OS Base – use this option
when you want to apply the base century of the operating system
being used to the dates being passed. For example, the two dates
that are passed are 85/03/29
and 99/03/29
. When
Trust Current OS Base is selected, 85
and 99
are
considered to be 1985 and 1999 if the current OS base is also a
1900 base century, or 2085 and 2099 if the current OS base is a
2000 base century.
Window Year – use this option when you want to set a two-digit window year to be applied by the engine to determine base century of the dates passed. Enter the two-digit year in the field next to the Window Year option. If the two-digit dates that are passed are greater than the number in the Window Year field, the engine assigns a 1900 base century. If the two-digit dates are less than or equal to that number, the engine assigns a 2000 base century.
%D, %Y
When setting the Window Year date, if you set it to
a date that is low, you must increase it before the end of that
year so the engine does not revert to 1900 when that year is over.
Refer to your platform and version-specific C developers guide for the valid strftime() arguments available to you. These arguments may vary depending on platform and OS version.
Converts the incoming data from Julian format (YYJJJ
or YYYYJJJ
)
to the format indicated by the arguments and places it into the
current output blob area.
Date Format – any format specifier that is valid with the C function strftime() and any ordinary characters.
Year 1900 Base – use this option
when both dates being passed have a 1900 base century (1900 – 1999).
For example, the two dates that are passed are 85/03/29
and 99/03/29
.
When Year 1900 Base is selected, 85
and 99
are
considered to be the years 1985 and 1999.
Year 2000 Base – use this option when both
dates being passed have a 2000 base century (2000-2999). For example,
the two dates that are passed are 01/03/29
and 05/03/29
.
When Year 2000 Base is selected, 01
and 03
are
considered to be 2001 and 2003.
Trust Current OS Base – use this option
when you want to apply the base century of the operating system
being used to the dates being passed. For example, the two dates
that are passed are 85/03/29
and 99/03/29
. When
Trust Current OS Base is selected, 85
and 99
are
considered to be 1985 and 1999 if the current OS base is also a
1900 base century, or 2085 and 2099 if the current OS base is a
2000 base century.
Window Year – use this option when you want to set a two-digit window year to be applied by the engine to determine base century of the dates passed. Enter the two-digit year in the field next to the Window Year option. If the two-digit dates that are passed are greater than the number in the Window Year field, the engine assigns a 1900 base century. If the two-digit dates are less than or equal to that number, the engine assigns a 2000 base century.
%a,%m,%d,%Y
Be careful when setting the Window Year date. If you
set it to a date that is low, remember to increase it before the
end of that year, so that the engine does not revert to 1900 when
that year is over.
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |