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

150
Vistas
JS Constant UK Timezone

I'd like the timestamp on this div to always show UK time regardless of where you are in the world. Currently it will show based on the user/browser location even though i've added the below to ensure UK time is visible.

function showDateTime() {
  var myDiv = document.getElementById("time");
  var event = new Date();
console.log(event.toLocaleString('en-GB', { timeZone: 'Europe/London' }));
  

When I try something different i.e the below, to test it's working, it doesn't change.

function showDateTime() {
  var myDiv = document.getElementById("time");
  var event = new Date();
console.log(event.toLocaleString('en-US', { timeZone: 'America/New_York' }));
  

https://jsfiddle.net/xgwsk2b3/

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