|
|
|
| Listing 5.4 | |
|
|
|
|
1 = BCAD_ON
OUTPUTS:
1. s, string, the formatted date.
NOTES:
1. The 'bcad_ind' indicator is not strictly correct in its output
results, since the date is formatted with 'A.D.' as a suffix, not a
prefix. This format is adopted for reasons of consistency, simplicity
and conformity with common usage (although common usage is incorrect).
2. Note that there is no year 0, by common usage. Therefore, years prior
to the year 1 represent dates 'B.C.'. A year '-N' is output by this
routine as '-N', or as 'N+1 B.C.', depending upon the setting of the
'bcad_ind' argument. E.g., year -4712 represents year 4713 B.C., year
0 represents the year 1 B.C., and so on.
3. This routine does not validate the input date.
4. To format a date using the numeric shorthand form 'YY/MM/DD', use
the related routine, 'format_date_numeric_YMD'. To format a date
using Day-Month-Year order, use the 'format_date_xxx_DMY' routines.
To format using Month-Day-Year order, use the 'format_date_xxx_MDY'
routines.
5. This routine assumes that the output space assigned is large enough
to contain the result. The maximum string length returnable by this
routine is 28 characters (-32768 September -32767 B.C.), so the
minimum safe space is 29 characters, to accomodate the string and
its null terminator.
*/
#include <stdio.h>
#include "scdtl_2.h"
void format_date_alpha_YMD (struct DATE_INFO *d, int bcad_ind, char *s)
{
int year, month, day;
year = d->year;
month = d->month;
day = d->day;
s [0] = '\0';
|
|
|
|
|
|
|
|