summaryrefslogtreecommitdiff
path: root/misc-utils/ddate.c
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2006-12-07 00:25:37 +0100
committerKarel Zak <kzak@redhat.com>2006-12-07 00:25:37 +0100
commit5c36a0eb7cdb0360f9afd5d747c321f423b35984 (patch)
tree147599a77eaff2b5fbc0d389e89d2b51602326c0 /misc-utils/ddate.c
parent2b6fc908bc368b540845a313c3b8a867c5ad9a42 (diff)
downloadutil-linux-old-5c36a0eb7cdb0360f9afd5d747c321f423b35984.tar.gz
Imported from util-linux-2.9i tarball.
Diffstat (limited to 'misc-utils/ddate.c')
-rw-r--r--misc-utils/ddate.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/misc-utils/ddate.c b/misc-utils/ddate.c
index f838d1c6..09704e0b 100644
--- a/misc-utils/ddate.c
+++ b/misc-utils/ddate.c
@@ -307,12 +307,20 @@ struct disc_time convert(int nday, int nyear)
#ifdef KILL_BOB
-/* Code for counting down to X-Day, X-Day being Cfn 40, 3164 */
+/* Code for counting down to X-Day, X-Day being Cfn 40, 3164
+ *
+ * After `X-Day' passed without incident, the CoSG declared that it had
+ * got the year upside down --- X-Day is actually in 8661 AD rather than
+ * 1998 AD.
+ *
+ * Thus, the True X-Day is Cfn 40, 9827.
+ *
+ */
int xday_countdown(int yday, int year) {
int r=(185-yday)+(((yday<59)&&(leapp(year)))?1:0);
- while(year<3164) r+=(leapp(++year)?366:365);
- while(year>3164) r-=(leapp(year--)?366:365);
+ while(year<9827) r+=(leapp(++year)?366:365);
+ while(year>9827) r-=(leapp(year--)?366:365);
return r;
}