# New Ticket Created by  Timothy Totten 
# Please include the string:  [perl #76552]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=76552 >


A small patch, just adds %z (to return the timezone string) to the
DateTime::strftime loadable library.
Oh, and I added myself to the CREDITS file, as moritz_ suggested I should on
my next patch.
>From 23f7c4bc5b9f9517c4d779117807157860d3ff16 Mon Sep 17 00:00:00 2001
From: Timothy Totten <2...@huri.net>
Date: Sat, 17 Jul 2010 21:52:54 -0700
Subject: [PATCH] Added %z to DateTime::strftime.

---
 CREDITS                  |    6 ++++++
 lib/DateTime/strftime.pm |    3 ++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/CREDITS b/CREDITS
index b35c7d1..2ca7fed 100644
--- a/CREDITS
+++ b/CREDITS
@@ -329,6 +329,12 @@ U: tene
 D: Minor Rakudo patches
 E: t...@allalone.org
 
+N: Timothy Totten
+U: novus
+D: Temporal (DateTime/Date) modifications
+E: superno...@gmail.com
+W: http://huri.net/
+
 N: Tyler Curtis
 U: tcurtis
 D: $*ARGFILES
diff --git a/lib/DateTime/strftime.pm b/lib/DateTime/strftime.pm
index 677641a..7986e30 100644
--- a/lib/DateTime/strftime.pm
+++ b/lib/DateTime/strftime.pm
@@ -41,7 +41,8 @@ module DateTime::strftime {
             '%' => { '%' },
             '3' => { (($dt.second % 1)*1000).fmt('%03d') },
             '6' => { (($dt.second % 1)*1000000).fmt('%06d') },
-            '9' => { (($dt.second % 1)*1000000000).fmt('%09d') }
+            '9' => { (($dt.second % 1)*1000000000).fmt('%09d') },
+            'z' => { $dt.timezone }
         ;
         my $result = '';
         while $format ~~ / ^ (<-['%']>*) '%' (.)(.*) $ / {
-- 
1.7.0.4

Reply via email to