Is this necessary when you want to get a date (or time) in format yyyy-mm-dd for writing to a database?
if ($_POST['month'] < 10) {
$month = "0".$_POST['month'];
} else {
$month = $_POST['month'];
}
When I get a date from a form that comes in in 3 seperate fields, month, day, and year, do I need to pad the month or day if it is less than 10? Same for time. I get my date in from a javascript that allows the user to pick from a calendar and my time comes in from a drop down list.
Does this also apply to pulling the data in from the db and displaying it in the form for updates?