[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: parse_time()
From: |
Bruno Haible |
Subject: |
Re: parse_time() |
Date: |
Sun, 2 Nov 2008 19:52:57 +0100 |
User-agent: |
KMail/1.5.4 |
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
- parse_time(), Bruce Korb, 2008/11/01
- Re: parse_time(),
Bruno Haible <=
- Re: parse_time(), Bruce Korb, 2008/11/02
- Re: parse_time(), Bruno Haible, 2008/11/02
- Re: parse_duration(), Bruce Korb, 2008/11/02
- Re: parse_duration(), Bruno Haible, 2008/11/03
- Re: parse_duration(), Bruce Korb, 2008/11/04
- Re: parse_duration(), Bruno Haible, 2008/11/05
- Re: parse_duration(), Bruce Korb, 2008/11/05
- Re: parse_duration(), Bruce Korb, 2008/11/16
- Re: parse_duration(), Bruno Haible, 2008/11/17
Re: parse_time(), Bruce Korb, 2008/11/02