-#include <tzfile.h>
-
-#define PI 3.141592654
-#define EPOCH 85
-#define EPSILONg 279.611371 /* solar ecliptic long at EPOCH */
-#define RHOg 282.680403 /* solar ecliptic long of perigee at EPOCH */
-#define ECCEN 0.01671542 /* solar orbit eccentricity */
-#define lzero 18.251907 /* lunar mean long at EPOCH */
-#define Pzero 192.917585 /* lunar mean long of perigee at EPOCH */
-#define Nzero 55.204723 /* lunar mean long of node at EPOCH */
-
-void adj360 __P((double *));
-double dtor __P((double));
-int main __P((int, char *[]));
-double potm __P((double));
+#include <time.h>
+#include <unistd.h>
+
+#ifndef PI
+#define PI 3.14159265358979323846
+#endif
+
+/*
+ * The EPOCH in the third edition of the book is 1990 Jan 0.0 TDT.
+ * In this program, we do not bother to correct for the differences
+ * between UTC (as shown by the UNIX clock) and TDT. (TDT = TAI + 32.184s;
+ * TAI-UTC = 32s in Jan 1999.)
+ */
+#define EPOCH_MINUS_1970 (20 * 365 + 5 - 1) /* 20 years, 5 leaps, back 1 day to Jan 0 */
+#define EPSILONg 279.403303 /* solar ecliptic long at EPOCH */
+#define RHOg 282.768422 /* solar ecliptic long of perigee at EPOCH */
+#define ECCEN 0.016713 /* solar orbit eccentricity */
+#define lzero 318.351648 /* lunar mean long at EPOCH */
+#define Pzero 36.340410 /* lunar mean long of perigee at EPOCH */
+#define Nzero 318.510107 /* lunar mean long of node at EPOCH */
+
+int main(int, char *[]);
+static void adj360(double *);
+static double dtor(double);
+static double potm(double);
+static time_t parsetime(char *);
+static void badformat(void) __dead;