I'm enjoying the module, but i can't figure out how to make it reflect the correct time.

The time is off by about 12 hours...Time zone is set up in drupal, and timer is set to 24 hours, and i read a previous support issue on this same topic, but i'm still stuck...here is the code snippet i'm using

<b>Countdown to Election</b>
<span class="countdowntimer">Count Down
<span style="display:none" class="datetime">2008-11-04T06:00:00-18:00</span>
<span style="display:none" class="tz_hours">-5</span>
<span style="display:none" class="dir">down</span>
<span style="display:none" class="format_txt"><em>Tuesday, November 4, 2008</em><br>%days% days + %hours%:%mins%:%secs%</span>
<span style="display:none" class="threshold">4</span>
<span style="display:none" class="complete">Custom Timer Complete Statement</span>
</span>

Also tried it without this line
<span style="display:none" class="tz_hours">-5</span>

Any help would be appreciated...

Also curious, if it possible to do a repeating timer (Id like to have a countdown timer for the stock market opening)
If not, will this be available in future versions

thanks

Comments

jvandervort’s picture

Status: Active » Postponed (maintainer needs more info)

In the version you are using the timezone is set in the datetime span (at the very end).

<span style="display:none" class="datetime">2008-11-04T06:00:00-18:00</span>

Which says you are 18 hours behind UMT, so if you want to be 5 hours behind, try this:
( 6am EST )

<b>Countdown to Election</b>
<span class="countdowntimer">Count Down
<span style="display:none" class="datetime">2008-11-04T06:00:00-05:00</span>
<span style="display:none" class="dir">down</span>
<span style="display:none" class="format_txt"><em>Tuesday, November 4, 2008</em><br>%days% days + %hours%:%mins%:%secs%</span>
<span style="display:none" class="threshold">4</span>
<span style="display:none" class="complete">Custom Timer Complete Statement</span>
</span>

PS: It also relies on the web browser's time. If your computer is not correct, the countdown won't be either.

Also, nice catch on the change in daylight saving ending Nov 2. Currently you'll be 1 hour off on the countdown until
after Nov 2. Then the time will be correct. I just haven't got around to detecting daylight saving time.

jvandervort’s picture

For a daily timer that resets you could use the php input format for a block or a node and use something like this:
(PHP 5.1+)

<?php
date_default_timezone_set('EST');
$now_t = time();
$opening_t = mktime(6, 00, 0, date("m",$now_t) , date("d",$now_t), date("Y",$now_t));
if ( $opening_t < $now_t ) {
  // todays opening is past, move to tomorrow
  $opening_t = $opening_t +  (24 * 60 * 60);
}
$opening_str = date('c', $opening_t);
?>
<?php print "$opening_str <br/>" ;?>
<span class="countdowntimer"><br />
<span style="display:none" class="datetime"><?php print $opening_str;?></span><br />
<span style="display:none" class="dir">down</span><br />
<span style="display:none" class="format_txt">%hours%:%mins%:%secs%</span><br />
<span style="display:none" class="complete">MISSION CUPLIDA2! </span><br />
<span style="display:none" class="tc_redir">/</span><br />
</span>
jvandervort’s picture

Status: Postponed (maintainer needs more info) » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.