05-28-2008, 06:07 AM
|
#3 (permalink)
|
|
The Frequenter
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
|
Although Adam's way is more thorough, you might want to use this.
PHP Code:
$sStartDate = explode('-', '2008-05-29'); // $sEndDate = explode('-', '2008-06-01'); Tanax got mad.
/* Now you would have something like $sStartDate[0]; would be 2008, being 1, 05 and 2, 29th.
Now, you could make a timestamp which I always use, it's more easier on the eyes if you ask me. */
$iStartDate = mktime(0, 0, 0, $sStartDate[1], $sStartDate[2], $sStartDate[0]);
/* Now, with that b-e-a-utiful function, you would recieve a timestamp which you can use almost anywhere. If you want to push a date onto the screen, use this. */
echo date('H:i:s d-m-Y', $iStartDate);
/* Note: I didn't try it, scripted it into this quickreply so there MIGHT be some errors - off to school now. */
Oh yes, $iStartDate being that it's a TOTAL integer (only numbers), and $sStartDate, being that it contains a dash which is not a numeric function, if checked with the is_numeric function. 
__________________
"Life is a bitch, take that bitch on a ride"
Last edited by ReSpawN : 05-28-2008 at 05:29 PM.
|
|
|