David:

Sorry. I wrote that out poorly. I missed the closing parenthesis on the foreach(). Here it is in a cleaned-up form:

<?php
foreach( $data as $r ) {
        list( $year, $month, $day ) = explode( "-", $r[ "Dates" ] );
        print date( "F jS Y", mktime( 0, 0, 0, $month, $day, $year ) );
}
?>

Oh, also, you could/should zero out your mktime( ) function so looks like this (although it's not terribly important):
mktime( 0, 0, 0, $month, $day, $year );


Apparently I had included the hours/minutes/seconds roughly corresponding to when I wrote the response.

Wes


On Jun 26, 2004, at 10:18 PM, David Blomstrom wrote:

--- Wesley Furgiuele <[EMAIL PROTECTED]> wrote:

Otherwise, you could use PHP's date formatting
functions as well
(assuming you are getting the date in YYYY-MM-DD
format:
<?php
foreach( $data as $r {
        list( $year, $month, $day ) = explode( "-",
$r['Dates'] );
        $formatted_date = date( "F jS, Y", mktime( 21, 39,
0, $month, $day,
$year ) );
print date( "F jS, Y", $timestamp );
}
?>
http://us2.php.net/manual/en/ref.datetime.php

Wow, that must be a record - getting three or four questions answered in one post. Thanks!

The only thing that I'm having trouble with is this:

<?php
foreach( $data as $r {
        list( $year, $month, $day )
        = explode( "-", $r['Dates'] );
        $formatted_date = date( "F jS, Y", mktime( 21, 39, 0,
$month, $day,
$year ) );
print date( "F jS, Y", $timestamp );
}
?>

I get a parse error that apparently derives from this
piece of code:

= explode( "-", $r['Dates'] );

Do you have any idea what the problem might be? I've
tried several variations without success.

Thanks.


__________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to