PHP Timezone incorrect When using time() -
i using time()
record current time in php application.
i based in uk use utc timezone. means in summer/winter switch gmt timezone bst (which gmt +1). problem that, time()
still uses gmt timezone means 1 hour behind. how make shows bst time 1 hour ahead of gmt?
when echo out time, 1 hour behind.
what have tried:
adding following pieces of code:
date_default_timezone_set("europe/london");
ini_set("date.timezone", "europe/london");
re-installing php 5.5 extensions storing timezones updated.
thanks
found solution.
the problem not time() seconds past date.
when coming show date, instead of using gmdate()
instead use date()
.
this take account default timezones set in document/ini file.
Comments
Post a Comment