Reputation: 175
I have a cakephp web application, for which Users can store their respective timezones in Profile table.
The date time stored with record is in UTC format and my date time fields are of VARCHAR(50) type.
I have followed many links amongst which following link helped most but unfortunately didn't work for me
http://alvarotrigo.com/blog/timezone-user-configuration-at-cakephp/
How can I show date time data depending upon user's Profile timezone. I don't want to make changes in every single fetching/retrieving functions.
Is there anyway to set timezone on application level, so that I will just fetch the Users timezone saved in Profile table and as per that I will set timezone for entire application.
p.s.: 1. the date time fields in my db are of VARCHAR(50) type
2. I would like to save date time in UTC format only
Upvotes: 1
Views: 175
Reputation: 507
Is there anyway to set timezone on application level, so that I will just fetch the Users timezone saved in Profile table and as per that I will set timezone for entire application.
I'm afraid, there's not.
I understand you've mentioned,
I don't want to make changes in every single fetching/retrieving functions.
But when I was in same situation, I used CONVERT_TZ function and modified my functions for fetching data.
Upvotes: 1