php - Change getInternalDate into user readable date? -


i got messages gmail api php,here have tried date getinternaldate output long number!so want change user readable date can't when format date() using php!!

$single_message = $service->users_messages->get('me', $message_id, $optparamsget2); $date = $single_message->getinternaldate();//'1464161738000' var_dump(date("y",$date));//  1956 ,should 2016 

seems getinternaldate return value in miliseconds instead of second. have divide 1000 , use date function.

$date = $single_message->getinternaldate() / 1000; var_dump(date("y-m-d h:i:s", $date)); 

Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -