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

268
Vistas
How to get utc datetime based on user's current datetime in js?

I try to get datetime based on user's current datetime. For example, if I want to get the start of the current date in utc,

const start = new Date()
start.setUTCHours(0,0,0,0)

if I want to get the end of the current date in utc,

const end = new Date()
end.setUTCHours(23,59,59,999)

but when I console.log start, it's

Sun Jun 05 2022 17:00:00 GMT-0700 (Pacific Daylight Time)

May I know why there's this "(Pacific Daylight Time)"? )

So what if I want to get 5 days ago of current datetimt? Like if now local datetime is 2:35pm pst, how do I get 5 days ago 2:35 pm but in utc (which should be 7:35pm right?) Thanks!

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