Why does the procedural code not get the same result as the Object-oriented code? I have legacy code which requires procedural result. Note I have a work-around but I'd like to understand why the Procedural Code doesn't get the local time.
`$dt = new DateTime("now", new DateTimeZone('America/Los_Angeles'));
$now = strtotime($dt->format('m/d/Y, H:i:s')); //This is a work-around which works
$oo = date('Y-m-d H:i:s',$now);
//Procedural Code
$now = date_timestamp_get($dt);
$pc = date('Y.m.d H:i:s',$now); `
Answer from the comments, courtesy Adyson
Well, you specified the timezone in the OO one, but not in the procedural one. So unless you're running this on a machine which happens to already be configured to the same timezone, then you won't get the same result from both of them. e.g. my computer's timezone is GMT so the procedural code gives me a time 8 hours later than the OO code