3

I would like to get the currently german time in JavaScript. Normally its GMT+1 but german time consists of the winter time and the summer time. In the summer time we are 1 hour ahead.

var now = new Date();
var hour = now.getUTCHours() + 1; // it works, but not by the summer-time
rink.attendant.6
  • 44,500
  • 61
  • 101
  • 156
user1643936
  • 45
  • 1
  • 5

1 Answers1

2

I always recommend using great library for date and time, which is Moment.js. You can achieve required functionality pretty easy. Check this SO thread out for more details: Moment.js - How To Detect Daylight Savings Time And Add One Day

Community
  • 1
  • 1
SOReader
  • 5,697
  • 5
  • 31
  • 53