How do I get the user’s local time into my Rails app?
I can’t ask for their timezone, nor do I want to use some API to get the time zone from the ip.
I think this might involve passing the Javascript date to my Rails app- how do I do that well? I can do it with therubyracer in my view, but that is messy.
If you want the user date through a form, you can have a hidden form field and use javascript to enter the user’s time into that field.
Alternatively, on
window.loadyou can send aAJAXcall(or similar) to some custom URL with the date-time in the params.