11 Replies Latest reply: Mar 22, 2013 9:10 AM by MurraySummers RSS

    Problem with update form and date (show 1970-01-01)

    kazzuni

      Hi, I've a update form (php/mysql) with many date input field. When my date is 000-00-00 I show 1970-01-01. Why??

       

      This is the code:

       

      label for="data_chiusura"><strong>Data chiusura</strong></label>

            <input type="text" name="Data_chiusura" value="<?php echo $string=$row_Recordset1['data_chiusura'];

          if($string == '0000-00-00'){

          $string = '';

          } else {

          $string = date("d-m-Y", strtotime($string));

          }; ?>" id="Data_chiusura">

       

      Thanks

       

      k