Re: Need help with time calculation for a tracking system - it DOES involve DB work :)
| From: | Jason Wong | Date: | Sat, 05 Oct 2002 10:31:29 +0000 |
| Subject: | Re: Need help with time calculation for a tracking system - it DOES involve DB work :) | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-22222@lists.php.net to get a copy of this message | ||
On Saturday 05 October 2002 03:45, Aaron Wolski wrote:
> Anyway.. everything as far as entering the time values, etc is working
> correctly except the calculation is NOT working as it should!!!
> $timeValue = date("g:i:s", $timeDifference);
> When I echo everything out to the browser this is what I get:
>
> The timeIn value is: 1033760057
> The timeOut value is: 1033760098
> The converted timeIn value is 3:34:17
> The converted timeOut value is 3:34:58
> The time difference between timeIn and timeOut is: 7:00:41
>
> You see.. the 7 is there... which represents 7 hours and 41 seconds that
> have elapsed. the 41 seconds is right.. but not the 7 hours!!!
date() returns the LOCAL time/date given a GMT/UTC timestamp. The timezone
where your server is located is probably 7 hours ahead of GMT/UTC.
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
If at first you don't succeed, you're doing about average.
-- Leonard Levinson
*/