How to force British Summer Time (UTC+1) when using dates in JavaScript? -


this question has answer here:

var d = new date(); document.getelementbyid('time').innerhtml = d.gethours() + ':' + d.getminutes(); 

when view code in browser home in london, see utc+1 time:

<div id="time">01:07</div> 

i'm pretty sure see utc+1 time because time of system's clock. viewing code in florida, time read 20:07 (utc-4).

how can force time output utc+1 everyone?

with moment.js timezone

document.getelementbyid('time').innerhtml = moment().tz('europe/london').format('hh:mm'); 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -