Date & Time Format
Posted: Thu May 06, 2010 11:26 am
First,
Does, date with timestamp type in mysql can be format when selected/display?
2010-05-06 19:49:33 >> 19:49:33 05-06-2010 [5-May-2010]
Second,
These code generating date & time like this: 6-5-2010 20:23:45.
I want to make it like this: 06-05-2010 20:23:45.
How to put "0" for number 1 to 9, since it using loop?
Does, date with timestamp type in mysql can be format when selected/display?
2010-05-06 19:49:33 >> 19:49:33 05-06-2010 [5-May-2010]
Second,
These code generating date & time like this: 6-5-2010 20:23:45.
I want to make it like this: 06-05-2010 20:23:45.
How to put "0" for number 1 to 9, since it using loop?
Code: Select all
<?
function fdate(){
//Date
echo "<select name=\"day\">";
for($d=1; $d<32; $d++){
echo ("<option>$d</option>");
}
echo "</select>";
//Month
echo "<select name=\"month\">";
for($m=1; $m<13; $m++){
echo ("<option>$m</option>");
}
echo "</select>";
//Year
$d = date(Y);
$b = date(Y)-2;
echo "<select name=\"year\">";
for($d; $d>$b; $d--){
echo ("<option>$d</option>");
}
echo "</select>";
}
?>