Simon Kirby ([EMAIL PROTECTED]) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
timestamp() converts timezone in wrong direction

Long Description
timestamp() and extracting epoch from dates is totally broken:                         
                          
                                                                                       
                          
db=# select "timestamp"(0);                                                            
                          
      timestamp                                                                        
                          
---------------------                                                                  
                          
 1970-01-01 08:00:00                                                                   
                          
(1 row)                                                                                
                          
                                                                                       
                          
This should be the same as "perl -le 'print scalar localtime(0)'", which               
                          
prints:                                                                                
                          
                                                                                       
                          
Wed Dec 31 16:00:00 1969                                                               
                          
                                                                                       
                          
db=# select extract(epoch from "timestamp"(0));                                        
                          
 date_part                                                                             
                          
-----------                                                                            
                          
     28800                                                                             
                          
(1 row)                                                                                
                          
                                                                                       
                          
timestamps should never be stored with timezones because that would                    
                          
remove the ability to describe times which overlap in daylight savings                 
                          
transitions.  It looks like timestamp() is converting in the wrong                     
                          
direction, and extract() is as well.                                                   
                          

Sample Code


No file was uploaded with this report


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Reply via email to