need "yy-ddd-hh:mm:ss ==> (time_t) clock" converter

Hugh Grierson hugh at fivegl.co.nz
Tue Feb 19 00:39:37 AEST 1991


In article <2323 at stsci.EDU> ansok at stsci.EDU (Gary Ansok) writes:
>In article <6586 at gssc.UUCP> timr at gssc.UUCP (Tim Roberts) writes:
>>> int mdays[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

>>int mdays[12] = { 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 };

>This is likely to go off into a "speed vs. style" war, but I tend to
>agree with those who say that unless this is a very time-critical
>piece of code (hard to imagine for a date conversion routine, but I
>suppose it's possible), the benefits of the first in readability and
>maintainability far outweigh any speed gained by the second.

Maintainability????  How often *do* you have to change the number
of days in a month?????  (Sept 1752 notwithstanding)

Readability? A one-line comment...

-- 
Hugh Grierson     hugh at fivegl.co.nz | Perfection is attained not when there is
5GL International Ltd,              | no more that can be added, but when there
Auckland, New Zealand               | is no more that can be taken away.



More information about the Comp.lang.c mailing list