I am trying to find the start date and end date of relative times in different timezones since client and server are in two different timezones.
If they are in the same timezone. I would be able to find the start date and end date as following:
const startDate = new Date(); startDate.setUTCHours(0,0,0,0); const endDate = new Date(); endDate.setUTCHours(23,59,59,999);
How could we get the start date and end date for the backend time zone given that we know the time zone or time zone offset for both frontend and backend? For example:
The goal is to get start time and end time for within today as following: