ALMANAC(3X)
NAME
almanac − return numeric date information in MPE format
SYNOPSIS
void almanac (date, err, pyear, pmonth, pday, pweekday)
unsigned short date, err[2];
short *pyear, *pmonth, *pday, *pweekday;
DESCRIPTION
Almanac returns numeric date information for a date in the packed date format returned by the calendar(3X) routine. 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 will be returned for Sunday and 7 for Saturday.
WARNINGS
This routine is provided for compatibility with MPE, another HP operating system. See portnls(5) for more information on the use of this routine. Use the Native Language Support routines for C programmers described on hpnls(5) for HP-UX NLS support.
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 7.0: Sept 1989