PHP date wrong while editing post
<p>I have a website in which users can open their own topics. If someone opens it, the shown date is correct, but if someone tries to edit the post, the shown date is incorrect. For example: if someone edits a post, the shown date is something like: 30/11/2008...</p>

<p>What might be the problem? It is odd because the date is shown correctly when a person does not edit the post...</p>

<p>Code:         </p>

<pre><code>function dateTime($date) {
    $z=explode(" ",$date);
    $tarih=$z[0];
    $saat=$z[1];
    $ilk=explode("-",$tarih);
    $son=explode(":",$saat);
    $temptime= mktime($son[0], $son[1], 0,$ilk[1], $ilk[2], $ilk[0]);

    $degisentrh=strftime('%d.%m.%Y %H:%M',$temptime);       
    return  $degisentrh;
}

function ToTime($date) {
    $z=explode(" ",$date);
    $tarih=$z[0];
    $saat=$z[1];
    $ilk=explode("-",$tarih);
    $son=explode(":",$saat);
    $temptime= mktime($son[0], $son[1], 0,$ilk[1], $ilk[2], $ilk[0]);

    $degisentrh=strftime('%H:%M',$temptime);        
    return  $degisentrh;
}

function DateAdd($interval, $number, $date) {

    $date_time_array = getdate($date);
    $hours = $date_time_array['hours'];
    $minutes = $date_time_array['minutes'];
    $seconds = $date_time_array['seconds'];
    $month = $date_time_array['mon'];
    $day = $date_time_array['mday'];
    $year = $date_time_array['year'];

    switch ($interval) {

        case 'yyyy':
            $year+=$number;
            break;
        case 'q':
            $year+=($number*3);
            break;
        case 'm':
            $month+=$number;
            break;
        case 'y':
        case 'd':
        case 'w':
            $day+=$number;
            break;
        case 'ww':
            $day+=($number * 7);
            break;
        case 'h':
            $hours+=$number;
            break;
        case 'n':
            $minutes+=$number;
            break;
        case 's':
            $seconds+=$number; 
            break;            
    }
       $timestamp= mktime($hours,$minutes,$seconds,$month,$day,$year);
    return $timestamp;
</code></pre>

<p>and you might need these snippets, where <em>if($updatetarih!=""){echo " ~ " . dateTime($updatetarih) ;}</em> is the date which is incorrect shown.</p>

<pre><code>&gt; SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
&gt;               SET time_zone = "+00:00";

  if($updatetarih!=""){echo " ~ " . dateTime($updatetarih) ;}

              `updatetarih` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '',

               &lt;?=dateTime($rowNews['date'])?&gt;)
</code></pre>

<p>Go easy on me blokes, I am a newbie here :)</p>
