"Caleb Walker" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am wondering if there is an easier way to format dates that come out of
a
> database. My database stores my date in the format- "YYYY-MM-DD". I know
> that I can take this and rearrange it with some string manipulation but is
> there any other easier way to do that say like making it say Sep. 09, 2001
> instead of 2001-09-09 without using ereg()?
sscanf("%d-%d-%d", $str, $year, $month, $day);
date("M. d, Y", mktime(0,0,0,$month,$day,$year));
--
PHP Database 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]