6 #include "simpletools.h" 10 datetime dt = {2015, 10, 23, 9, 12, 7};
52 while(states != 0b1000000)
136 if(states == 0b0000001)
140 else if(states == 0b0000100)
144 else if(states == 0b0000010)
173 if(states == 0b0000001)
178 else if(states == 0b0000100)
183 else if(states == 0b0000010)
212 if(states == 0b0000001)
217 else if(states == 0b0000100)
222 else if(states == 0b0000010)
251 if(states == 0b0000001)
256 else if(states == 0b0000100)
261 else if(states == 0b0000010)
290 if(states == 0b0000001)
295 else if(states == 0b0000100)
300 else if(states == 0b0000010)
329 if(states == 0b0000001)
334 else if(states == 0b0000100)
339 else if(states == 0b0000010)
void dt_toTimeStr(datetime dt, char *s)
Populates a string (minimum 9 characters) with the hh:mm:ss representation of a datetime type's time...
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.
void dt_toDateStr(datetime dt, char *s)
Populates a string (minimum 9 characters) with the mm/dd/yy representation of a datetime type's date...
void dt_set(datetime dt)
Set the system date and time. This can be used to change the system's current date/time. Example datetime mydt={2015, 9, 25, 8, 13, 51}; dt_set(mydt); You can also use this to change the datetime type that was used in dt_start to "set" the second counter that auto-increments.