Changeset 80

Show
Ignore:
Timestamp:
10/02/07 12:51:24 (15 months ago)
Author:
verbosus
Message:

Fixed issue with bloody PHP mktime and yyyy-mm-dd pubDates

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • hacks/trunk/feedphp/feed.php

    r79 r80  
    66   *  
    77   * author: Antonio Cavedoni <http://cavedoni.com/> 
    8    * version: 0.3 
     8   * version: 0.4 
    99   * revision: $Id$ 
    1010   * license: BSD 
     
    113113            // yyyy-mm-dd 
    114114            $d = strptime($params['pubDate'], "%Y-%m-%d"); 
     115            $itemDate = mktime( 
     116                0, 0, 0,  
     117                $d['tm_mon'] + 1, // bloody zero-indexed PHP month numbers! 
     118                $d['tm_mday'], 
     119                $d['tm_year'] 
     120            ); 
     121 
    115122        } else if (strlen($params['pubDate']) == 19) { 
    116123            // yyyy-mm-dd hh:mm:ss 
    117124            $d = strptime($params['pubDate'], "%Y-%m-%d %H:%M:%S");             
    118         } 
    119  
    120         $itemDate = mktime( 
    121             $d['tm_hour'],  
    122             $d['tm_min'], 
    123             $d['tm_sec'], 
    124             $d['tm_mon'] + 1, // bloody zero-indexed PHP month numbers! 
    125             $d['tm_mday'], 
    126             $d['tm_year'] 
    127         ); 
     125            $itemDate = mktime( 
     126                $d['tm_hour'],  
     127                $d['tm_min'], 
     128                $d['tm_sec'], 
     129                $d['tm_mon'] + 1, // bloody zero-indexed PHP month numbers! 
     130                $d['tm_mday'], 
     131                $d['tm_year'] 
     132           ); 
     133        } 
    128134 
    129135        $item = array(