/* yeardate = 2000 monthdate = 02 daydate = 02 */
$date = new DateTime($yeardate.'-'.$monthdate.'-'.$daydate);
echo date('Y/m/d', strtotime($date));
Keeps echoing 1970/01/01 or something on the lines of that.
/* yeardate = 2000 monthdate = 02 daydate = 02 */
$date = new DateTime($yeardate.'-'.$monthdate.'-'.$daydate);
echo date('Y/m/d', strtotime($date));
Keeps echoing 1970/01/01 or something on the lines of that.
here you are, try to use proper class like below:
<?php
$date = DateTime::createFromFormat('Y-m-d', '2000-02-02');
echo $date->format('Y/m/d');
?>