ok well i have this error with a counter i made witch is suppost to count down to 0
$time=1283593330+(60*15);
$time3= time();
$time2=$time-$time3;
1283593330=Sat, 04 Sep 2010 09:42:10 GMT
Error is this:
when the $time3 timestamp hit the timestamp for $time it says 05:00:00 instande of 00:00:00.
This is the code i use to call it.
Time left: '.date('g:i:s ',$time2).'<br />
im not sure if im doing something wrong, if 5 is the main time for unix_timestamp or the date commend in PHP
is there anyway to fix this? or is this from of timestamp just that bad of a idea for what i need.
Your time zone is 5 hours ahead of UTC: you say 1283593330 is 09:42, but it’s actually 04:42 UTC.
When
$time2is zero, this represents the Unix time epoch: this is midnight UTC on 1st January 1970. So when you output this usingdate, it shows that time in your time zone: 00:00 UTC which is 05:00 in your time zone.What’s important is that
$time2is zero when the target time is reached.Given that your counter is counting down 15 minutes, you can get the remaining time like this: