[asterisk-bugs] [Asterisk 0015078]: STRFTIME returns incorrect time

Asterisk Bug Tracker noreply at bugs.digium.com
Mon May 11 11:13:36 CDT 2009


The following issue requires your FEEDBACK. 
====================================================================== 
http://bugs.digium.com/view.php?id=15078 
====================================================================== 
Reported By:                alecdavis
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   15078
Category:                   Functions/func_strings
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     feedback
Asterisk Version:           SVN 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-05-11 06:52 CDT
Last Modified:              2009-05-11 11:13 CDT
====================================================================== 
Summary:                    STRFTIME returns incorrect time
Description: 
For NZ (GMT+12) function STRFTIME seems to require GMT-12 to get the date
and time right.

by example, the date and time now in NZ is 11th May 2009 , 11:27PM

Dialplan code:
exten => _9.,1,NoOp(${STRFTIME(${EPOCH},GMT-12,%Z %z %C%y%m%d%H%M)})
exten => _9.,n,Set(CallTime=${STRFTIME(${EPOCH},GMT-12,%C%y%m%d%H%M)})
exten => _9.,n,Set(CALLFILENAME=${CallTime}_${CALLERID(num)})

Console output: The Date and Time are correct. 200905112327
    -- Executing [9045609100 at outbound:1] NoOp("SIP/100-09fc4128", "NZST
+1200 200905112327") in new stack
    -- Executing [9045609100 at outbound:2] Set("SIP/100-09fc4128",
"CallTime=200905112327") in new stack

System time:
========================================
asterisk:/# date
Mon May 11 23:27:44 NZST 2009
asterisk:/#


====================================================================== 

---------------------------------------------------------------------- 
 (0104527) tilghman (administrator) - 2009-05-11 11:13
 http://bugs.digium.com/view.php?id=15078#c104527 
---------------------------------------------------------------------- 
ls -l /usr/share/zoneinfo/NZST
ls: cannot access /usr/share/zoneinfo/NZST: No such file or directory

When localtime cannot find the zoneinfo file, it reverts to using GMT.

I suspect the zone you want is REALLY "NZ" or "NZ-CHAT":

ls -l /usr/share/zoneinfo/NZ*
-rw-r--r-- 1 root root 2434 2009-03-30 09:55 /usr/share/zoneinfo/NZ
-rw-r--r-- 1 root root 2018 2009-03-30 09:55 /usr/share/zoneinfo/NZ-CHAT
 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-05-11 11:13 tilghman       Note Added: 0104527                          
2009-05-11 11:13 tilghman       Status                   new => feedback     
======================================================================




More information about the asterisk-bugs mailing list