php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22764 date() fails to negative timestamps
Submitted: 2003-03-18 07:28 UTC Modified: 2003-03-19 05:31 UTC
From: lahme at 4all-networks dot de Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.3.2RC1 OS: Linux
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: lahme at 4all-networks dot de
New email:
PHP Version: OS:

 

 [2003-03-18 07:28 UTC] lahme at 4all-networks dot de
if you?ve saved negative timestamp in a database and put it on frontend by date("d.m.Y",$timestamp); you will only see the 1.1.1970 .. 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-18 09:17 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Certain libc implementations do not support negative timestamps.
 [2003-03-18 12:05 UTC] lahme at 4all-networks dot de
@iliaa ...

i copied this from the manual... so it IS a BUG!!!!

"date -- Format a local time/date
Description
string date ( string format [, int timestamp])


Returns a string formatted according to the given format string using the given integer timestamp or the current local time if no timestamp is given. In otherwords, timestamp is optional and defaults to the value of time(). 

Note: The valid range of a timestamp is typically from Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are the dates that correspond to the minimum and maximum values for a 32-bit signed integer). On windows this range is limited from 01-01-1970 to 19-01-2038. 

To generate a timestamp from a string representation of the date, you may be able to use strtotime(). Additionally, some databases have functions to convert their date formats into timestamps (such as MySQL's UNIX_TIMESTAMP function). "
 [2003-03-19 05:31 UTC] georg@php.net
Thanks,
but we already know the content of the manual! Please read carefully what Ilia wrote!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 03 21:01:31 2024 UTC