Skip Menu |

This queue is for tickets about the TimeDate CPAN distribution.

Report information
The Basics
Id: 45067
Status: resolved
Priority: 0/
Queue: TimeDate

Owner: Nobody in particular
Requestors: emhn [...]

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)

CC: Graham Barr <gbarr [...]>
MIME-Version: 1.0
X-Spam-Status: No, hits=-1.0 required=8.0 tests=RCVD_IN_DNSWL_LOW
X-Mailer: Evolution
X-Virus-Checked: Checked by ClamAV on
X-Virus-Scanned: by amavisd-new
Message-ID: <1239832801.4183.76.camel [...]>
Content-Type: multipart/mixed; boundary="=-B4mpc8Mnu3kzekApm90z"
Reply-To: emhn [...]
Organization: Universidad Simón Bolívar
Received: from ( []) by (Postfix) with SMTP id 096894DCF97 for <bug-timedate [...]>; Wed, 15 Apr 2009 18:00:31 -0400 (EDT)
Received: (qmail 27571 invoked by uid 103); 15 Apr 2009 22:00:31 -0000
Received: from ( by with QMQP; 15 Apr 2009 22:00:31 -0000
Received: from (HELO ( by (qpsmtpd/0.80) with ESMTP; Wed, 15 Apr 2009 15:00:24 -0700
Received: from ( [] (may be forged)) by (8.14.3/8.14.3/Debian-5) with ESMTP id n3FM09BE029553 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 15 Apr 2009 22:00:14 GMT
Received: from [] (localhost []) by (8.14.3/8.14.3/Debian-5) with ESMTP id n3FM01h0026335; Wed, 15 Apr 2009 17:30:02 -0430
Delivered-To: cpan-bug+timedate [...]
Subject: Date::Format with %z gives wrong results for half-hour timezones
Return-Path: <emhn [...]>
X-Original-To: bug-timedate [...]
Date: Wed, 15 Apr 2009 17:30:01 -0430
X-Spam-Level: *
To: bug-timedate [...]
From: Ernesto Hernández-Novich <emhn [...]>
Content-Length: 0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-RT-Original-Encoding: utf-8
Content-Length: 1147
Download (untitled) / with headers
text/plain 1.1k
Using Date::Format to format a date including the timezone as an offset (%z) does not work correctly if the offset is not an even number of hours. I noticed the problem since I run my systems using VET (-4:30) and several mail Date: headers built with Date::Format broke. print time2str("%Z %z", $^T, "-0430") gives -0430 -041800 instead of -0430 -0430 The bug is in line 239 of Date/ in function format_z, and I've fixed it with sprintf("%+03d%02d", int($o / 3600), int(abs($o) % 3600) / 60); It also works for timezones with other weird offsets like +1245 (Catham Islands) +0545 (Kathmandu) and I even tried with things like -0417. Attached a simple test for the bug. This bus is breaking RequestTracker 3.6 and 3.8 if the system runs on any timezone that's not a round number of hours. This bug is also reported in Debian BTS [1]. [1] -- Prof. Ernesto Hernández-Novich - MYS-220C Geek by nature, Linux by choice, Debian of course. If you can't aptitude it, it isn't useful or doesn't exist. GPG Key Fingerprint = 438C 49A2 A8C7 E7D7 1500 C507 96D6 A3D6 2F4C 85E3
content-type: application/x-perl; name="z.t"
content-disposition: attachment; filename="z.t"
Content-Transfer-Encoding: 7bit
Content-Length: 529
Download z.t
text/x-perl 529b

Message body is not shown because sender requested not to inline it.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to