Php cli timezone


#1

how can i make
$filename = date(“Ymd-h”).".mp3";
refelect the current time in my timezone, eastern ?


#2
<?php $timezone = -4; // I think EST is -4 hours GMT $est = (gmdate('U') + ($timezone * 60 * 60)); $filename = date("Ymd-h", $est).".mp3"; ?>

#3

ok i tried to get it to work
looks like i get the right output if change timezone to +3
does that make any sense?


#4

In fact it should be -5 hours, I’ve checked the EST time here http://www.time.gov/timezone.cgi?Eastern/d/-5/java and here http://wwp.greenwichmeantime.com/time-zone/usa/eastern-time/

Do this

<?php echo gmdate('h:i a d-m-Y'); ?>

and compare the time given with the GMT time here http://wwp.greenwichmeantime.com/