Bug 20159

Summary: strftime() can't produce ISO8601 format timezone representation
Product: Base System Reporter: Phil Pennock <pdp>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.5-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Phil Pennock 2000-07-24 23:10:01 UTC
ISO 8601 defines date and time representations.  See
 <http://www.iso.ch/markete/8601.pdf>
It defines formats for representation of timezone.  The one of interest
is the [+-]nnnn representation, as used in various email headers.
strftime() does not currently provide a way to get this, leaving it to
the programmer to roll their own wrapper.

Since %Z gives timezone, and %z is available for use, the patch below
(against 3.5-STABLE) for /usr/src/lib/libc/stdtime/strftime.c will add
the desired functionality, provided that ISO8601_TIMEZONES is defined.

This is experimental, and there is no bounds checking for bad values in
the struct tm, so the patch does nothing to define ISO8601_TIMEZONES.

How-To-Repeat: Use strftime(3).
Comment 1 iedowse freebsd_committer freebsd_triage 2002-08-10 00:57:24 UTC
State Changed
From-To: open->closed


A similar change to this was made quite some time ago.