B
bob
If I have a year and the day of the year (e.g. yyyy.ddd), is there
some simple way to convert this to a time_t? mktime(), of course, does
just the opposite and uses tm_mon and tm_mday, ignoring tm_yday.
There's the obvious brute force approach of subtracting 31, 28, 31,
30, etc... until you arrive at the right result (being careful to allow
for leap years, of course), but it seems like there ought to be some
standard library routine for this purpose.
It only has to work for "modern" days, post 1970.
Thanks,
Bob Armstrong
some simple way to convert this to a time_t? mktime(), of course, does
just the opposite and uses tm_mon and tm_mday, ignoring tm_yday.
There's the obvious brute force approach of subtracting 31, 28, 31,
30, etc... until you arrive at the right result (being careful to allow
for leap years, of course), but it seems like there ought to be some
standard library routine for this purpose.
It only has to work for "modern" days, post 1970.
Thanks,
Bob Armstrong