dates
Posted: Thu Jul 14, 2005 7:21 am
hi all,
i have a random entry of the way people have entered the month of a date, for example
21 february
has been entered as:
21/feb
21/FEB
21/Feb
21/february
21/February
21/FEBRUARY
21/2
21/02
I tried to run this script with
21/feb and it gave the output:
"2004-12-21" why?
this is my script
i have a random entry of the way people have entered the month of a date, for example
21 february
has been entered as:
21/feb
21/FEB
21/Feb
21/february
21/February
21/FEBRUARY
21/2
21/02
I tried to run this script with
21/feb and it gave the output:
"2004-12-21" why?
this is my script
Code: Select all
<?php
$dd = '21/feb';
$pieces = explode("/", $dd);
$d = $pieces[0];
$m = $pieces[1];
$y = date("Y");
$term_started = date('Y-m-d',mktime(0,0,0,$m,$d,$y));
echo $term_started;
?>