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

692
Vistas
How can i get accurate date time according to the current time zone in angular

I want to get the exact date and time when user opens a page in his browser. I am trying to achieve this by using 'new Date()'.

 console.log(new Date());

Now, the issue is that it is picking user's machine time by default. For example, if I change my machine time manually, the output will be changed accordingly.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

There are several ways to achieve this, 2 are listed below:

  1. Use a timeserver, for instance via ntp-time package

https://www.npmjs.com/package/ntp-time

  1. Use a server request (requires that you host your Angular SPA on a server):

Right way to get Web Server time and display it on Web Pages

about 4 years ago · Juan Pablo Isaza Denunciar
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