Skip to content

Instantly share code, notes, and snippets.

@philnelson
Created January 17, 2012 20:44
Show Gist options
  • Save philnelson/1628764 to your computer and use it in GitHub Desktop.
Save philnelson/1628764 to your computer and use it in GitHub Desktop.
check if time is between 8am and 7pm PST
var a = new Date;
var hours = a.getHours();
var hourOffset = a.getTimezoneOffset()/60;
var timeNow = hours + hourOffset;
if (18 == a.getDate() && 0 == a.getMonth() && 2012 == a.getFullYear() && timeNow >= 13 && timeNow <= 24) {
window.location = "http://sopastrike.com/strike";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment