| @@ 159-175 (lines=17) @@ | ||
| 156 | // Output a raw date string in the selected locale date format |
|
| 157 | // $raw_date needs to be in this format: YYYY-MM-DD HH:MM:SS |
|
| 158 | // NOTE: Includes a workaround for dates before 01/01/1970 that fail on windows servers |
|
| 159 | function tep_date_short($raw_date) { |
|
| 160 | if ( ($raw_date == '0000-00-00 00:00:00') || ($raw_date == '') ) return false; |
|
| 161 | ||
| 162 | $year = substr($raw_date, 0, 4); |
|
| 163 | $month = (int)substr($raw_date, 5, 2); |
|
| 164 | $day = (int)substr($raw_date, 8, 2); |
|
| 165 | $hour = (int)substr($raw_date, 11, 2); |
|
| 166 | $minute = (int)substr($raw_date, 14, 2); |
|
| 167 | $second = (int)substr($raw_date, 17, 2); |
|
| 168 | ||
| 169 | if (@date('Y', mktime($hour, $minute, $second, $month, $day, $year)) == $year) { |
|
| 170 | return date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $year)); |
|
| 171 | } else { |
|
| 172 | return preg_replace('/2037$/', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037))); |
|
| 173 | } |
|
| 174 | ||
| 175 | } |
|
| 176 | ||
| 177 | function tep_datetime_short($raw_datetime) { |
|
| 178 | if ( ($raw_datetime == '0000-00-00 00:00:00') || ($raw_datetime == '') ) return false; |
|
| @@ 599-614 (lines=16) @@ | ||
| 596 | // Output a raw date string in the selected locale date format |
|
| 597 | // $raw_date needs to be in this format: YYYY-MM-DD HH:MM:SS |
|
| 598 | // NOTE: Includes a workaround for dates before 01/01/1970 that fail on windows servers |
|
| 599 | function tep_date_short($raw_date) { |
|
| 600 | if ( ($raw_date == '0000-00-00 00:00:00') || empty($raw_date) ) return false; |
|
| 601 | ||
| 602 | $year = substr($raw_date, 0, 4); |
|
| 603 | $month = (int)substr($raw_date, 5, 2); |
|
| 604 | $day = (int)substr($raw_date, 8, 2); |
|
| 605 | $hour = (int)substr($raw_date, 11, 2); |
|
| 606 | $minute = (int)substr($raw_date, 14, 2); |
|
| 607 | $second = (int)substr($raw_date, 17, 2); |
|
| 608 | ||
| 609 | if (@date('Y', mktime($hour, $minute, $second, $month, $day, $year)) == $year) { |
|
| 610 | return date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $year)); |
|
| 611 | } else { |
|
| 612 | return preg_replace('/2037$/', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037))); |
|
| 613 | } |
|
| 614 | } |
|
| 615 | ||
| 616 | //// |
|
| 617 | // Parse search string into indivual objects |
|