php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3424 Date function not accurate for seconds
Submitted: 2000-02-07 23:24 UTC Modified: 2000-08-01 17:15 UTC
From: ddwyer at ncic dot com Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.14 OS: NT 4
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ddwyer at ncic dot com
New email:
PHP Version: OS:

 

 [2000-02-07 23:24 UTC] ddwyer at ncic dot com
According to the documentation, the timestamp is the number of seconds since 12am 1/1/70.  A day has 60*60*24 (86400) seconds in it.

When I use the function:

date("H:i:s",86400);
...it replies 17:00:00 (5pm)

When I plug in a higher number, 107999, that gets me to 23:59:59-- a 30-hour day?

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-02-08 04:13 UTC] mrobinso at cvs dot php dot net
Try... date("H:i:s",time()+86400);
                    ^^^^^^^

or ... date("H:i:s",time()+107999);


 [2000-08-01 17:15 UTC] hholzgra@php.net
base for timestamps is 12am 1/1/70 GMT (!)
while date() will use your local timezone 


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Fri Jul 03 08:00:02 2026 UTC