11 #include "simpletools.h" 16 int l, n, i, j, d, m, y;
35 n = ( 4 * l ) / 146097;
36 l = l - ( 146097 * n + 3 ) / 4;
37 i = ( 4000 * ( l + 1 ) ) / 1461001;
38 l = l - ( 1461 * i ) / 4 + 31;
39 j = ( 80 * l ) / 2447;
40 d = l - ( 2447 * j ) / 80;
42 m = j + 2 - ( 12 * l );
43 y = 100 * ( n - 49 ) + i + l;
45 return (y<<16) | (m<<8) | d;
This library provides convenient functions for a variety of timekeeping operations. This library makes use of a manual Spin to C translation of functions from Bob Belleville's date_time_epoch.spin for converting to/from between epoch time (seconds from midnight, 1/1/1970) and a datetime format.