Link to home
Start Free TrialLog in
Avatar of DelphiMan7
DelphiMan7

asked on

How to detect a users date/time locale in PHP?

Is it possible to detect a users locale in PHP so that I can display a date in their country format.  

i.e. if a user from the US visits the site they see the date in mm/dd/yyyy format, and if someone from the UK visits the site then they see it in dd/mm/yyyy.  

ASP.Net does this automatically, I'm wondering if it is possible to do it in PHP (by reading their browser settings, not loooking up their IP addres).  
Avatar of Shahzad Fateh Ali
Shahzad Fateh Ali
Flag of Pakistan image

Hi DelphiMan7,

You cannot detect user timezone using php, but javascript can do this for you. You can also use combination of both where javascript will pass locale information to server.

ASKER CERTIFIED SOLUTION
Avatar of DelphiMan7
DelphiMan7

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial