DateTime breaking code PHP -
my code is:
$etime = $arr['od']; $ds = date("y-m-d h:i:s", strtotime($etime)); $timezone=new datetimezone("utc"); // declare whatever timezone $etimed=new datetime($ds,$timezone); // resultset datetime
$arr['od']
2017-08-20 19:05:59
, trying echo $etimed
breaks code don't know why?
datetime object, cannot echoed that, therefore need format datetime echo code below:
$etime = $arr['od']; $ds = date("y-m-d h:i:s", strtotime($etime)); $timezone=new datetimezone("utc"); // declare whatever timezone $etimed=new datetime($ds,$timezone); // resultset datetime echo $etimed->format('y-m-d h:i:s');
Comments
Post a Comment