Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.org
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
Occurs once every four years (1 + 4 = 5) and is inserted between
the 59th and 60th days of the Season of Chaos.
** THE YEAR
| | | | | | | | ST | BT | PD | PP | SO | | | | | | | | | SM | BT | PD | PP | SO | |
| | | | | | | | SM | BT | PD | PP | SO | | | | | | | | | SM | BT | PD | PP | SO | |
|-----+----+----+----+----+-----+---+----+----+----+----+----+-----+-----+----+----+----+----+----+---+----+----+----+----+----+-----|
| Jan | 1 | 2 | 3 | 4 | 5 | | 1 | 2 | 3 | 4 | 5 | Chs | Jul | 5 | 6 | 7 | 8 | 9 | | 40 | 41 | 42 | 43 | 44 | Cfn |
| | 6 | 7 | 8 | 9 | 10 | | 6 | 7 | 8 | 9 | 10 | | | 10 | 11 | 12 | 13 | 14 | | 45 | 46 | 47 | 48 | 49 | |
Expand Down
30 changes: 26 additions & 4 deletions ddate.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
15th of Confusion, 3180:
- call out adherents of the wrong fruit

3181-Afm-51 Jim Wisniewski <wisnij+ddate@gmail.com>
- added ISO_FORMAT option

FIVE TONS OF FLAX
*/

Expand All @@ -54,6 +57,12 @@

#define OLD_IMMEDIATE_FMT

/* If you wish to use the ISO 8601 format for aneristic dates (y-m-d), as
* opposed to the Commonwealth format, define ISO_FORMAT.
*/

/* #define ISO_FORMAT */

/* If you wish to use the US format for aneristic dates (m-d-y), as opposed to
* the Commonwealth format, define US_FORMAT.
*/
Expand Down Expand Up @@ -214,20 +223,33 @@ main (int argc, char *argv[]) {
if (argc-pi==3){
int moe=atoi(argv[pi]), larry=atoi(argv[pi+1]), curly=atoi(argv[pi+2]);
hastur=makeday(
#ifdef US_FORMAT
moe,larry,
#ifdef ISO_FORMAT
larry,curly,moe
#else
# ifdef US_FORMAT
moe,larry,
# else
larry,moe,
# endif
curly
#endif
curly);
);
if (hastur.season == -1) {
printf("Invalid date -- out of range\n");
return -1;
}
fnord=fnord?fnord:default_fmt;
} else if (argc!=pi) {
usage:
fprintf(stderr,("usage: %s [+format] [day month year]\n"), argv[0]);
fprintf(stderr,("usage: %s [+format] ["
#if defined(ISO_FORMAT)
"year month day"
#elif defined(US_FORMAT)
"month day year"
#else
"day month year"
#endif
"]\n"), argv[0]);
exit(1);
} else {
t= time(NULL);
Expand Down