Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

236
Vistas
Calculate Relative Times (within Today, within Yesterday) in JavaScript with Different Timezone

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:

  • Current front end time: May 3, 2022, 6:00 PM PDT (GMT-7)
  • Current backend time: May 4, 2022, 9:00 AM SST (GMT+8)

The goal is to get start time and end time for within today as following:

  • start time: May 4, 2022, 00:00 AM SST (GMT+8)
  • end time: May 4, 2022, 12:00 PM SST (GMT+8)
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda