I am trying to calculate the day of the week from seconds from the point in time. Of time.hI can use gmtime(), but it increases the program from 1.3kB, possibly because it gmtime()also calculates the date.
So, I am wondering what would be wrong in using something like:
(timestamp / (24*3600)) % 7
The only thing I could think of was leaps of seconds, so something like 00:00:02 could be called the wrong day.
edit
This is for embedded programming, 1.3kB is an essential part of the 64kB program / firmware. Also, I do not expect to do anything with time zones or dates after that.
source
share