note 73243 added to function.mktime

From: Date: Wed, 14 Feb 2007 12:57:58 +0000
Subject: note 73243 added to function.mktime
Groups: php.notes 
Request: Send a blank email to php-notes+get-123371@lists.php.net to get a copy of this message
Hello, I use this function and code to get difference beetween 2 days and i get 2-3 diferent values as i load the code. First is good and the other are big numbers. Does anybody have an ideea why is that. I ckeced the dates are ok and generated corectly. I think the mktime function has problems. The script is runing on hosting that has php 4.4.4 and cpanel. I tested the script on windows server and it is working. Any ideeas? function dateDiff($dformat, $endDate, $beginDate) { $date_parts1=explode($dformat, $beginDate); $date_parts2=explode($dformat, $endDate); $start_date=gregoriantojd($date_parts1[0], $date_parts1[1], $date_parts1[2]); $end_date=gregoriantojd($date_parts2[0], $date_parts2[1], $date_parts2[2]); return $end_date - $start_date; } $exp = explode("-",$_SESSION["date"]); $m=$exp[1]; $d=$exp[2]; $Y=$exp[0]; $date = $m."-".$d."-".$Y; $date2=date("m-d-Y"); $nrWeeksPassed=(dateDiff("-", $date2, $date) ---- Server IP: 69.147.83.197 Probable Submitter: 86.125.183.11 ---- Manual Page -- http://www.php.net/manual/en/function.mktime.php Edit -- https://master.php.net/note/edit/73243 Del: integrated -- https://master.php.net/note/delete/73243/integrated Del: useless -- https://master.php.net/note/delete/73243/useless Del: bad code -- https://master.php.net/note/delete/73243/bad+code Del: spam -- https://master.php.net/note/delete/73243/spam Del: non-english -- https://master.php.net/note/delete/73243/non-english Del: in docs -- https://master.php.net/note/delete/73243/in+docs Del: other reasons-- https://master.php.net/note/delete/73243 Reject -- https://master.php.net/note/reject/73243 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#123371) next »