php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11152 different date() values on different platforms and versions
Submitted: 2001-05-28 06:48 UTC Modified: 2001-05-28 21:35 UTC
From: bignat at mail dot com Assigned:
Status: Closed Package: Date/time related
PHP Version: 4.0.5 OS: Linux RedHat 7.0/Win 98
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
37 - 12 = ?
Subscribe to this entry?

 
 [2001-05-28 06:48 UTC] bignat at mail dot com
on windows 98 (apache module, 4.0.5):

<?php
echo date('j',86400);
// it's: 2
?>

on Linux (apache module, 4.0.5):

<?php
echo date('j',86400);
// it's: 1 !!!
?>

please decide whether is 1 or 2 !
(it occurs in time calculations,
when I try to find out the number
of days between two dates.. quite
ugly..)

I cannot change it with every new
version.. and it's quite important
in finances, acccountability etc..

Anyway, your work it's great!
And PHP it's so easy to use,
and so intuitive!

Thanx a lot!
Daniel BI

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-28 21:35 UTC] sniper@php.net
You have just discovered daylight savings time..
I get 2 on my linux box..
So check your timezone. Definately not bug in PHP.

And date() expects a full timestamp anyway. 
This is not the way to count days between dates.


--Jani

 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Jul 07 00:05:45 2022 UTC