Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Moment js utc() time in london - BST

I'm using momentjs lib to updated text on some ajax action. What I need to do is to set a current date & time in london. I'm using moment.utc() function but because of the summer time I'm one hour out.

For example running this on 14:26

console.log( moment.utc().format('HH:mm:ss') );

I'm getting 13:26:53.

Any idea on how to fix this?

like image 778
Arek S Avatar asked Aug 04 '14 13:08

Arek S


1 Answers

Can you use momentJS timezone?

moment().tz('Europe/London');

EDIT: In case you try to use this without seeing the link, it's a separate library you have to include.

like image 98
ConnectedSystems Avatar answered Sep 22 '22 00:09

ConnectedSystems