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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 13:01:28 2024 UTC