Sept. 27, 2022
3:22 p.m.
FWIW, the "indirect" implementation of mktime() (et.al.) wasn't for any efficiency aims - in fact, IMO, any application for which the efficiency of mktime() matters is probably doing something badly wrong, and the whole method ought to be reconsidered. Rather, I always considered it the right way for two reasons - it always works (regardless of what type time_t happens to be - back then that was even less settled than today ... dealing with unsigned time_t vs signed sometimes causes issues), and second, it means all the various rules (days/month, leap years, ....) need appear only in one place, rather than in two. The latter is what really swung it for me. kre