almanac(3X)
NAME
almanac() − return numeric date information in MPE format
SYNOPSIS
void almanac(
unsigned short int date,
unsigned short int err[2],
short int *pyear,
short int *pmonth,
short int *pday,
short int *pweekday
);
DESCRIPTION
almanac() returns numeric date information for a date in the packed date format returned by the calendar() routine (see calendar(3X)). The returned information is:
year of the century
month of the year
day of the month
day of the week
The arguments to almanac() are used as follows:
date An unsigned short containing the date about which information is to be returned. The year of the century is packed into bits 0 through 6, and the day of the year is packed into bits 7 through 15. The packed date format is:
| Bits | 0 | 6 | 7 | 15 |
| _ | _ | _ | _ | |
| Year of Century | Day of Year | |||
| _ | _ | _ | _ | |
err The first element of this array contains the error number. The second element is always zero. If the call is successful, both elements contain zero.
Error # Meaning
1 No parameters are present in which to return values: pday, pmonth, pyear, and pweek all point to zero.
2 Day of the year is out of range.
3 Year of the century is out of range.
pyear A pointer to a short in which the year of the century is returned.
pmonth A pointer to a short in which the month of the year is returned (for example, January is represented by 1 and December is represented by 12).
pday A pointer to a short in which the day of the month is returned.
pweekday A pointer to a short in which the weekday is returned.
Note that 1 is returned for Sunday and 7 for Saturday.
WARNINGS
This routine is provided for compatibility with MPE, a proprietary HP operating system. See portnls(5) for more information on the use of this routine. Refer to hpnls(5) for information about Native Language Support routines used in C programs in the HP-UX NLS environment.
AUTHOR
almanac() was developed by HP.
SEE ALSO
calendar(3X), nlfmtdate(3X), ctime(3C), portnls(5).
EXTERNAL INFLUENCES
International Code Set Support
Single- and multi-byte character code sets are supported.
Hewlett-Packard Company — HP-UX Release 9.10: April 1995