How to get timezone offset from the date getting from client side?
问题 I am working with nodejs. I am getting the startDate as startDate: '2020-06-14T18:30:00.000Z' from the client side. I need to get the timezone offset from the above date. It should be +05:30. How can I get that? Edit: Server always works on UTC. So can I get the timezone offset by subtracting the date coming from the client by the UTC one? i.e. '2020-06-14T18:30:00.000Z' - moment.utc().startOf("day") = +05:30 回答1: If the node.js syntax is the same as plain JS; declare a date object with: var