Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
157
rated 0 times [  161] [ 4]  / answers: 1 / hits: 18161  / 10 Years ago, mon, august 4, 2014, 12:00:00

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?


More From » datetime

 Answers
27

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.


[#69920] Saturday, August 2, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
maya

Total Points: 418
Total Questions: 116
Total Answers: 112

Location: Mauritania
Member since Sun, Oct 17, 2021
3 Years ago
maya questions
Sun, Jul 4, 21, 00:00, 3 Years ago
Tue, Dec 22, 20, 00:00, 4 Years ago
Fri, Nov 6, 20, 00:00, 4 Years ago
Wed, Jul 29, 20, 00:00, 4 Years ago
Tue, Apr 21, 20, 00:00, 4 Years ago
;