[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#799476: libc6: strftime should allow extended-format timezone (ISO 8601)



On Sat, Sep 19, 2015 at 12:20:39 -0400, Michael Gold wrote:
> strftime should be able to output the timezone with a colon
> [...] Perhaps a new flag could be used, e.g. "%:z".
> 
> A way to output ±hh if mm==00, or ±hh:mm otherwise, may be useful too.
> Maybe "%3z" or "%:3z"

Actually, I see the GNU date utility already defines formats for these:
    %z     +hhmm numeric time zone (e.g., -0400)
    %:z    +hh:mm numeric time zone (e.g., -04:00)
    %::z   +hh:mm:ss numeric time zone (e.g., -04:00:00)
    %:::z  numeric time zone with : to necessary precision
           (e.g., -04, +05:30)

It reimplements strftime to do so.

-- Michael

Attachment: signature.asc
Description: Digital signature


Reply to: