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

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -