function - PHP get user's local time (in SMF) -
i know php isn't handy when gets fetching local time because requires user have cookie corresponding offset. i'm looking value user's time using smf (which should have information in databse). couldn't find out how using smf's site, i'm asking here.
if you're wondering why, it's because have 2 themes "day" , "night" theme. want night 1 displayed if time falls between 2 corresponding times.
btw can see these themes here: http://hetoan2.com/forum , night: http://hetoan2.com/forum?v=night
thanks :d
easily best way use date() method in javascript. gives date , time of user's machine.
if, however, want use php (for whatever reason), use geolocation tool ipinfodb users current location , use date_default_timezone_set set timezone of user timezone of server, , date way.
Comments
Post a Comment