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:


$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;



It works, but sheesh...

Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger

PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to