[asterisk-bugs] [Asterisk 0012374]: STRPTIME does not respect time dayligh saving time

noreply at bugs.digium.com noreply at bugs.digium.com
Sun Apr 6 20:27:14 CDT 2008


The following issue has been SUBMITTED. 
====================================================================== 
http://bugs.digium.com/view.php?id=12374 
====================================================================== 
Reported By:                johan
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   12374
Category:                   Core-General
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
Asterisk Version:           1.4.19 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             04-06-2008 20:27 CDT
Last Modified:              04-06-2008 20:27 CDT
====================================================================== 
Summary:                    STRPTIME does not respect time dayligh saving time
Description: 
STRPTIME is an hour off because of daylight saving time.

This dialplan:
  Set(datewithtz=${STRFTIME(${EPOCH},Europe/Stockholm,%Y-%m-%d
%H:%M:%S)});
  Set(datenotz=${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)});
  Noop(${STRPTIME(${datewithtz},GMT-2,%Y-%m-%d %H:%M:%S)});
  Noop(${STRPTIME(${datewithtz},Europe/Stockholm,%Y-%m-%d %H:%M:%S)});
  Noop(${EPOCH});

prints this:
 Set("datewithtz=2008-04-07 03:22:08") in new stack
 Set("datenotz=2008-04-07 03:22:08") in new stack
 NoOp("1207531328") in new stack   <--- this one is right (workaround) 
 NoOp("1207534928") in new stack   <--- this one is wrong (should work)
 NoOp("1207531328") in new stack   <--- this is EPOCH.

As you see the result is off by an hour. STRFTIME works fine but STRPTIME
does not.
====================================================================== 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
04-06-08 20:27  johan          Asterisk Version          => 1.4.19          
04-06-08 20:27  johan          SVN Branch (only for SVN checkou => N/A          
  
======================================================================




More information about the asterisk-bugs mailing list