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
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: 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

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-24 10:14 UTC] hholzgra@php.net
daylight saving time ...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 05:01:30 2024 UTC