php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18538 Probleme with mktime()
Submitted: 2002-07-24 09:44 UTC Modified: 2002-07-24 10:14 UTC
From: cyril dot joui at 123bootik dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 4.2.1 OS: Win2000
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: cyril dot joui at 123bootik dot com
New email:
PHP Version: OS:

 

 [2002-07-24 09:44 UTC] cyril dot joui at 123bootik dot com
We have probleme when $date >= 2002-10-20 <= 2002-10-31

You can try to do this :
------------EXAMPLE --------------
<?php

$date_depart 	= "2003-10-26";
// We add 7 days to $date_depart
$date_apres 	= calcul_date_ajoute_jour($date_depart,7);
// $date_apres is false ... ????
?>
------------END OF EXAMPLE --------------

// Add days to date
function calcul_date_ajoute_jour($date,$nbjour){ // Date au Format Am?ricain
	return date_plus($nbjour,1,$date);
}

function date_time($i) {
	$i = strtotime($i);
	//echo "$i = $i<br>";
	return mktime(
	date("H", $i),
	date("i", $i),
	date("s", $i),
	date("m", $i),
	date("d", $i),
	date("Y", $i));
}

function date_plus($e = 2, $o = 2,$d=1) {
	if ($d==1) $d=date("Y-m-d");
	
	$aujourdui = date_time($d);
	$apres = getdate(($aujourdui + (86400 * $e)));
	
	$mois=substr("0".$apres[mon],-2,2);
	$jour=substr("0".$apres[mday],-2,2);
	if($o == 2) return $mois . "-" . $jour;
	else return $apres[year] . "-" . $mois . "-" . $jour;
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-24 10:14 UTC] hholzgra@php.net
daylight saving time ...
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 10:01:33 2025 UTC