1

I've got a Rails JSON API that gets called by my client app, ie:

[GET] /posts?time=today

Previously I was getting today's date by calling Date.today, but this causes bugs because it uses the server's timezone and not the user's timezone.

I know it's a long shot, but is there a way to fix this without having to update the client to pass in the current timezone? I could do an IP lookup, but it seems too heavyweight. Is the timezone information passed in anywhere in the request?

nathan
  • 1,456
  • 1
  • 15
  • 32

0 Answers0