Permalink
Browse files

Fixed time issue.

  • Loading branch information...
1 parent 393a491 commit fd4567753165b131c462654c38f3e43f46513cbd @mattonomics committed Jan 16, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 protest-sopa-pipa/protest-sopa-pipa.php
@@ -28,14 +28,17 @@
new protest_sopa_pipa;
class protest_sopa_pipa {
- public $start = 1326891600; // 1/18/2012 8am EST
- public $end = 1326934800; // 1/18/2012 8pm EST
+ public $start = "2012-01-18 08:00:00 -05:00"; // 1/18/2012 8am EST
+ public $end = "2012-01-18 20:00:00 -05:00"; // 1/18/2012 8pm EST
public function __construct() {
$time = time();
- if ( ( $time > $this->start ) && ( $time < $this->end ) )
+ $start = strtotime($this->start);
+ $end = strtotime($this->end);
+
+ if ( ( $time > $start ) && ( $time < $end ) )
$this->on();
- elseif ( $time > $this->end )
+ elseif ( $time > $end )
$this->off();
}

0 comments on commit fd45677

Please sign in to comment.