php - Getting User time zone related date -


this question has answer here:

hi have task in need capture user access details browser, os version , timezone using.

however able work around solution of detecting browser , os version.

i looking solution php code can detect timezone user having when tried access web page. how convert time of user server time.

thanks in advance.

-new date().gettimezoneoffset()/60; 

gettimezoneoffset() subtract time gmt , return number of minutes. if live in gmt-8, return 480. put hours, divide 60. also, notice sign opposite of need -- it's calculating gmt's offset time zone, not time zone's offset gmt. fix this, multiply -1


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -