php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11245 Problems with both the DATE and STRTOTIME functions.
Submitted: 2001-06-01 17:47 UTC Modified: 2001-06-01 18:11 UTC
From: yavor at is99 dot com Assigned:
Status: Closed Package: Date/time related
PHP Version: 4.0 Latest CVS (2001-06-01) OS: Win NT4.0, also Win98
Private report: No CVE-ID: None
 [2001-06-01 17:47 UTC] yavor at is99 dot com
The following code:


<?php

$b = "04/04/1999 00:00";
$timestamp = strtotime ($b);
echo "$timestamp\r\n";

$test =  date ("m/d/Y H:i",$timestamp);
echo "$test\r\n";

$b = "04/04/1999 01:00";
$timestamp = strtotime ($b);
echo $timestamp."\r\n";

$test =  date ("m/d/Y H:i",$timestamp);
echo "$test\r\n";

$b = "04/04/1999 02:00";
$timestamp = strtotime ($b);
echo $timestamp."\r\n";

$test =  date ("m/d/Y H:i",$timestamp);
echo "$test\r\n";

$b = "04/04/1999 02:00";
$timestamp = strtotime ($b);
echo $timestamp."\r\n";

$test =  date ("m/d/Y H:i",$timestamp+3600);
echo "$test\r\n";

$b = "04/04/1999 03:00";
$timestamp = strtotime ($b);
echo $timestamp."\r\n";

$test =  date ("m/d/Y H:i",$timestamp);
echo "$test\r\n";

$b = "04/04/1999 04:00";
$timestamp = strtotime ($b);
echo $timestamp."\r\n";

$test =  date ("m/d/Y H:i",$timestamp);
echo "$test\r\n";

?>




Returns these results:

E:\PHP\scripts>php test.php
X-Powered-By: PHP/4.0.3pl1
Content-type: text/html

923205600
04/04/1999 00:00
923209200
04/04/1999 01:00
923209200
04/04/1999 01:00
923209200
04/04/1999 03:00
923212800
04/04/1999 03:00
923216400
04/04/1999 04:00

Apparently, there are problems with both the strtotime and date functions.

Thanks!

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-01 18:11 UTC] sniper@php.net
Works for me just fine with PHP 4.0.6RC1.
(you obviously are not using latest CVS:
X-Powered-By: PHP/4.0.3pl1 )

--Jani

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 10:01:29 2024 UTC