Converting dates in php

converting a date string 09/17/2014

to a unix time stamp and then to a date format to insert into myql as a date

<?php
 $time = "09/17/2014";
echo $time."<br/>";
 $date = strtotime($time);
echo $date."<br/>";
 $timestamp=$date;
 echo gmdate("Y-m-d", $timestamp);
 ?>

you will have to add an extra day to the resulting day so this is not a solution but a start

 

This entry was posted in php, web, Web Technology. Bookmark the permalink.