-2

I have developed a website for my client that will run on multiple countries & timezone. I storing all the records in UTC & while showing the data to the user , i again convert that to the user timezone & its working fine. But facing problem while retrieving the records based on a given date or date range. Let me give a example

On 1st Nov 2017 when my client logged into admin dashboard check all the records for the month & he is from USA & his timezone is UTC-8Hour , so in his system it was 31 Oct 2017. So he wanted to see all the records of Oct instead of Nov.

Thanks

pkk
  • 283
  • 4
  • 19
  • 1
    Please read [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) and [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) from the help center. Thanks. – Matt Johnson-Pint Nov 02 '17 at 18:15

1 Answers1

0

You can solve this on the server side. Just check if the current time minus/plus the time zone of the user changes the month. If it does, just change the month in your SQL (or whatever database language you use) query.

For client's time zone check, see this post

Jan Kl.
  • 69
  • 2
  • 13