> -----Original Message----- > From: Christoph Siefer [mailto:[EMAIL PROTECTED]] > Sent: 26 September 2002 16:16 > > I expecting > > <?php > > $timestamp = ($now - $five_minutes_ago); > print date(H:i:s, $timestamp); > > ?> > > to print something like "00:05:00". > > The two given timstamps, differing (e.g.) five minutes, wich is 300 > seconds, print this instead: "01:05:00". > Whatever I try, the result always is an hour to much.
This looks like it might be a time-zone issue, as I'd guess being in Germany you're 1 hour different from GMT. Let's see: $timestamp should contain 300, which equates to 00:05:00 01-Jan-1970 GMT -- but if you're 1 hour ahead of GMT, date will compensate for this and return 01:05:00 01-Jan-1970 in your local timezone. Try using gmdate instead, which does not do any timezone compensation. Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php