
03-16-04, 11:41 AM
|
|
Newbie Coder
|
|
Join Date: Sep 2003
Location: Argentina
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
|
Originally Posted by NeverMind
if you are getting your date from a timestamp this is how to do what you want:
if you are already having the date in DD-MM-YYYY from Mysql for example do this:
I used the $array[key] method but you can do the same with $array = array('d' => date('j', $timestamp), ... etc..
|
Thanks.. i've solved it with this:
PHP Code:
function arrayEntreFechas($primerFecha, $segundaFecha) { $f1 = explode("-", $primerFecha); $f1 = mktime(0,0,0,$f1[1],$f1[0],$f1[2]); $f2 = explode("-", $segundaFecha); $f2 = mktime(0,0,0,$f2[1],$f2[0],$f2[2]); $fechaMasUno = $f1; $c = 0; while ($fechaMasUno != $f2) { $fechaMasUno += 86400; $tmp = explode("-", date("d-m-Y",$fechaMasUno)); $tmpArray[$c] = array("d" => $tmp[0], "m" => $tmp[1], "y" => $tmp[2]); $c++; } return $tmpArray; }
|