[MacPorts] #24544: erlang:localtime_to_universaltime returns wrong timestamp when using DST

MacPorts noreply at macports.org
Sun Apr 18 12:21:32 PDT 2010


#24544: erlang:localtime_to_universaltime returns wrong timestamp when using DST
--------------------------------+-------------------------------------------
 Reporter:  dcestari@…          |       Owner:  macports-tickets@…                   
     Type:  defect              |      Status:  new                                  
 Priority:  Normal              |   Milestone:                                       
Component:  ports               |     Version:  1.8.2                                
 Keywords:                      |        Port:  erlang                               
--------------------------------+-------------------------------------------
 erlang:localtime_to_universaltime calls mktime on the host OS and
 interpretes the result
 as an unix timestamp.

 the thing is, on BSD (there for, on OS X) the mktime function returns -1
 when the tm_dst
 is 1 and the current timezone doesn't have DST.

 erlang doesn't check for this abnormal result and interpretes it wrongly
 as a second before
 unix epoch.

 I attached a patch that checks for this result and tries to get the
 timestamp without the
 tm_dst.

-- 
Ticket URL: <http://trac.macports.org/ticket/24544>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list