Hi, Bruce Korb wrote: > I had need of a function to convert some variation of a time (duration) > specification into a count of seconds. For your amusement and optional > inclusion...(I *think* I've got papers on file for gnulib....) > > It accepts several formats: > > [DD d] [HH h] [MM m] [SS s] > [DD d] [[HH:]MM:]SS > [DD d] [HH h] [MM:]SS > > though it is unhappy if it finds nothing.
Yes, I think if several programs can agree to parse durations in the same way, this can only be beneficial. Looking at wikipedia [1], I would find it good if 1) the function was called 'parse_duration', not 'parse_time' (since "time" often denotes a time instant within a day), 2) the three duration formats described in [1] were also supported. Bruno [1] http://en.wikipedia.org/wiki/ISO_8601#Durations