1

Hi first time posting here so bear with me.

I've got a live stream that I want to show on Sundays between 6am and 2pm (CEST - Central European Summer Time)

I've got the first part down but how do I make it timezone specific? Make sense?

$(document).ready(function() {

var d = new Date();
var n = d.getDay();
var hour = d.getHours();

if(n == 0 && hour >= 6 && hour < 14)
{
 $(".stream").show();
} else {

$(".stream").hide();
}
} );

PS I understand this doesn't hide it completely outside of those times and that's fine. I'm just looking for a solution that works on the client side.

JackMC
  • 11
  • 2
  • You have to convert the `Date` object to CEST and then run your checks. Since CEST is UTC+2, try: `var now = new Date(); var now_cest = new Date(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours() + 2, now.getUTCMinutes(), now.getUTCSeconds());` Use `now_cest` for your checks now. – rgajrawala Oct 08 '15 at 22:36
  • Solution from [here](http://stackoverflow.com/a/6777470/2006429). – rgajrawala Oct 08 '15 at 22:41

0 Answers0