2

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
  • 40,889
  • 58
  • 100
  • 149

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,287
  • 5
  • 29
  • 52