I have a web API to store some values in a table with datetime. Server db has UTC timezone and thus stores the datetime in UTC format.Is it correct to store server time in the datetime field or need to take the client time as input?
Next the other API gives a list of data in json format with some datetime values. Since the response is in json format, it will convert the datetime values to milliseconds.In jQuery we use moment.js to format the datetime values and display to user. It automatically displays the datetime based on the browser timezone to user but sometimes displays wrong value.
Is the above approach of handling timezone correct? What's the best approach if my web application is to be accessed from different parts of the world, and suppose the same request has to be updated from different parts.?