9 #include "simpletools.h" 14 datetime dt = {2015, 10, 23, 8, 2, 44};
28 if(dt.
h == 0 || dt.
h == 12) hrs = 12;
31 oledprint(
" %04d.%02d.%02d\n\n %02d:%02d:%02d ",
32 dt.
y, dt.
mo, dt.
d, hrs, dt.
m, dt.
s);
datetime dt_get()
Get the current system time. To find the current system time (as a datetime type), call this function. Note: This assumes that a call to dt_run has been made. This is common near the beginning of a program that uses the system timekeeping.
void dt_run(datetime dt)
Run a date/time second counting process in another cog. Example: datetime dts = {2015, 9, 25, 8, 11, 04}; dt_run(dts);.
< datetime_st Structure containing y, mo, h, m, and s elements.
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.