I've created a React weather app that returns various pieces of info when you search by city. One of those pieces of info is the date. My problem is that the date returned reflects the date of the location where the browser is located. For example, if it is "12/20/2021" and I'm in Chicago but it's "12/21/2021" in Shanghai, when I search Shanghai from Chicago it shows the date as "12/20/2021" instead of the date in Shanghai. How can I get my app to reflect the date based upon the city being searched instead of based on where the user is located?
Thanks
This Stack Overflow question may be of use; in particular this answer provides steps for how to translate your city first into its corresponding time zone, and then fetch the current time and date for that corresponding time zone.