Re: timestamp formatting on display?
| From: | CPT John W. Holmes | Date: | Tue, 26 Aug 2003 20:18:36 +0000 |
| Subject: | Re: timestamp formatting on display? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-30103@lists.php.net to get a copy of this message | ||
From: "Aaron Wolski" <aaronjw@martekbiz.com>
> Having a brain laps and not sure where in the manual to look and sadly I
> need a QUICK solution.
>
> I have a date formatted in a table like: 20030826132457
>
> Now.. I went to MySQL timestamp from UNIX timestamps because I like the
> readability of them when just looking at the Tables. How would I format
> the date something like: August 26, 2003??
>
> I could easily do this with a UNIX timestamp.. not sure if the same is
> possible with this type of timestamp. Also.. I can't use the MYSQL
> functions to format the data into a UNIX TimeStamp. not int his query.
How about using DATE_FORMAT() in your query to format the date? It works
almost the same way as date() in PHP.
If not, run the date through strtotime() and then use date() to format it.
---John Holmes...