Question 1 - I have an app that is on shared hosting in Dallas, TX...so my database/web server are currently set to Central US time...I'm unable to change this, so UTC is off the table.
My application records and displays Date and Time data to the user, but every user could be in a different time zone.
If I configure my app (config.time_zone = 'Central Time (US & Canada)')
, but then I allow users to select their timezone,
def user_time_zone(&block)
Time.use_zone(current_user.time_zone, &block)
end
will RoR display any returned data in the timezone of the user's choice? Or do I need to evaluate the data and modify it accordingly before it is displayed?
Question 1.1 - I have related mailers that send daily/weekly/monthly reports to users. If I run these using CRON, would I need to schedule my jobs to at different time intervals to allow for the timezones? In other words, if one job contains
when 'daily'
@dates = params[:f]['Date Range'] = "#{Date.current} - #{Date.current}"
Date.current will be 1 hour ahead on the East Coast, and 3 hours behind on the West and so forth. So (still using server timezone of Central), would I run one at 11pm (for East) and one at 2am (for West)?
Any and all advice/assistance is greatly appreciated. Thanks!