There's gotta be an easier way to get create a date
properly formatted for MySQL's standard YYYY-MM-DD
DATE field format. Any suggestions,
smacks-upside-the-head, etc. on how to reduce this
would be greatly appreciated.
Here's my code:
<?php
$today = getdate();
$year = $today['year'];
$month = $today['mon'];
$mday = $today['mday'];
if ($month < 10) {
// $month = join("0",$today['mon']);
$month = "0";
$month .= $today['mon'];
}
$printtoday = $year;
$printtoday .= "-";
$printtoday .= $month;
$printtoday .= "-";
$printtoday .= $mday;
print($printtoday);
?>
It works, but sheesh...
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]