kumarjcet
asked on
How to get client time zone to server from browser for showing based on that.
the web app runs joomla on apache server running Mysql as dB.
the server timezone is set to UTC and time values are too saved in UTC in dB.
a registered user in the site can store his events details in calendar in his account.
this details will be available to others on the site for them to interact.
the problem is that the user recieves the details in UTC for himself and others too. even if the user gives the time zone details at the time of registration, it will become static. for eg if the user changes time zone during travel, the content will be available for the old time zone only.
if i use JS to change the content on load, there are issues related tooltip and calendar positioning as the calendar is processed by PHP not JS. so i need the user time zone value in server for PHP to process the object variable.
If there is a way using server request or some other means to sort this problem out, it will be really helpful.
thanks in advance, i guess i have not missed out anything in explaining about issue.
the server timezone is set to UTC and time values are too saved in UTC in dB.
a registered user in the site can store his events details in calendar in his account.
this details will be available to others on the site for them to interact.
the problem is that the user recieves the details in UTC for himself and others too. even if the user gives the time zone details at the time of registration, it will become static. for eg if the user changes time zone during travel, the content will be available for the old time zone only.
if i use JS to change the content on load, there are issues related tooltip and calendar positioning as the calendar is processed by PHP not JS. so i need the user time zone value in server for PHP to process the object variable.
If there is a way using server request or some other means to sort this problem out, it will be really helpful.
thanks in advance, i guess i have not missed out anything in explaining about issue.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER