Wrong arithmetics with date()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mimcris
Forum Newbie
Posts: 1
Joined: Sat Aug 10, 2002 4:55 am
Location: Turin - Italy

Wrong arithmetics with date()

Post by mimcris »

Hi!
Look at this statement:

print date("i:s", 3599); // result -> 59:59 - right!

print date("H.i:s", 3599); // result -> 01.59:59 - wrong of course!

print date("H.i.s", 3600); // result -> 02.00:00 - Crazy or not!
I've tried with many params but it seems that the hour value is always shifted 1 ahead.

Anyone can help?
Tks
Mimmo
firepages
Forum Newbie
Posts: 5
Joined: Sun Jul 28, 2002 4:22 am
Location: Perth::Australia

Post by firepages »

then try a more valid timestamp

print date("i:s", 00000000003559);
print date("H.i:s", 00000000003559);

I also get +8 but I assume thats my locale

I assume you are GMT +1 ??
Post Reply