- var_dump: documentation ( source)
- ini_set: documentation ( source)
- date: documentation ( source)
<?php
ini_set('date.timezone', 'America/Los_Angeles');
$nowDate = new \DateTime('now', new DateTimeZone('America/New_York'));
$programTime = new \DateTime(date('Y-m-d') . " 06:00", new DateTimeZone('America/New_York'));
$lengthSeconds = 75 * 60;
$endDate = $programTime->add(new \DateInterval('PT' . $lengthSeconds . 'S'));
$diff = $endDate->getTimestamp() - $nowDate->getTimestamp();
var_dump($diff,
$endDate->format('d-m-y H:i'),
$nowDate->format('d-m-y H:i'),
$endDate->getTimestamp(),
$nowDate->getTimestamp()
);
/*
Local gives me:
int -69587
string '22-07-14 07:15' (length=14)
string '23-07-14 02:34' (length=14)
int 1406027700
int 1406097287
*/