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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bignat at mail dot com
New email:
PHP Version: OS:

 

 [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: Sat May 21 23:03:34 2022 UTC