RE: [PHP] date convertion
| From: | Dan Joseph | Date: | Tue, 09 Dec 2003 15:09:08 +0000 |
| Subject: | RE: [PHP] date convertion | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-172266@lists.php.net to get a copy of this message | ||
Hi,
> I have a script where a user inputs a date in YYYYMMDD format, and I need
> to convert it to month day, year. For example they will enter 20031209
> and I need the script to return the date as December 09, 2003.
> They won't
> be entering today's date, so I can't use the timestamp with the date
> function. So any ideas?
Check out date() and mktime().
Example:
date( "m, d, Y", mktime( 0, 0, 0, MM, DD, YYY ) );
You'll have to check the date() page for more info on which letters to use
to get the format you want.
-Dan Joseph