Answers for "javascript date to php date site:stackoverflow.com"

PHP
0

javascript date to php date site:stackoverflow.com

//Javascript
var d = new date();
var iso_date_string = d.toISOString(); 
// produces "2014-12-15T19:42:27.100Z"
var locale_date_string = d.toLocaleDateString();
// produces "12/15/2014"

//PHP
$date = date( "Y-m-d H:i:s", strtotime("2014-12-15T19:42:27.100Z") );
// produces "2014-12-15 20:42:27"
$date = date( "Y-m-d", strtotime("12/15/2014") );
// 2014-12-15
Posted by: Guest on July-30-2021

Browse Popular Code Answers by Language