Reputation: 6358
Here is what I am struggling with.
I have to determine whether current time, time_t
, is overlapping with a triplet of
day of week (0 Sunday to 6 Saturday)
start time = minutes from midnight
end time = minutes from midnight
So 1/17/2012 13:00:00 does overlap with 2(tuesday) 600, 900 1/17/2012 13:00:00 does not overlap with 1(monday) 0, 1000
Any thoughts on how to implement this?
Thanks Reza
Upvotes: 0
Views: 284
Reputation: 249652
Convert your time_t
to a struct tm
using localtime_r
(or localtime_s
on Windows). Then you will have day of the week (in tm_wday
) and the various other values you can compare against.
Upvotes: 1