Ignore:
Timestamp:
Jun 6, 2012, 12:55:57 AM (12 years ago)
Author:
plg
Message:

bug 2646 fixed: avoid useless PHP warnings with uncompleted creation date

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions.inc.php

    r15316 r15573  
    492492  $formated_date = '';
    493493  // before 1970, Microsoft Windows can't mktime
    494   if ($show_day_name and $ymdhms[0] >= 1970)
     494  if ($ymdhms[0] >= 1970 and $ymdhms[1] != 0 and $ymdhms[2] != 0)
    495495  {
    496496    // we ask midday because Windows think it's prior to midnight with a
     
    498498    $formated_date.= $lang['day'][date('w', mktime(12,0,0,$ymdhms[1],$ymdhms[2],$ymdhms[0]))];
    499499  }
    500   $formated_date.= ' '.$ymdhms[2];
    501   $formated_date.= ' '.$lang['month'][(int)$ymdhms[1]];
     500
     501  if ($ymdhms[2] != 0)
     502  {
     503    $formated_date.= ' '.$ymdhms[2];
     504  }
     505
     506  if ($ymdhms[1] != 0)
     507  {
     508    $formated_date.= ' '.$lang['month'][(int)$ymdhms[1]];
     509  }
     510 
    502511  $formated_date.= ' '.$ymdhms[0];
    503512  if ($show_time and count($ymdhms)>=5 )
Note: See TracChangeset for help on using the changeset viewer.