RE: [PHP] Sorting Dates in this format: Jul 21 2001
| From: | Maxim Maletsky | Date: | Fri, 10 Aug 2001 04:52:55 +0000 |
| Subject: | RE: [PHP] Sorting Dates in this format: Jul 21 2001 | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-62110@lists.php.net to get a copy of this message | ||
oops, you're right. Sorry, haven't read your mail well enough.
<sarcasm>if you'd put a few brackets like strtotime(), I would probably
notice</sarcasm>
Sorry again,
m
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
maxim@phpbeginner.com
www.phpbeginner.com
-----Original Message-----
From: David Robley [mailto:huntsman@www.nisu.flinders.edu.au]
Sent: Friday, August 10, 2001 1:47 PM
To: Maxim Maletsky; PHP (E-mail)
Subject: Re: [PHP] Sorting Dates in this format: Jul 21 2001
On Fri, 10 Aug 2001 13:20, Maxim Maletsky wrote:
> and the third option is:
>
> strtotime()
>
> read on about this magic function - will become your life(ass)-saver.
> www.php.net/strtotime
>
>
> Sincerely,
>
> Maxim Maletsky
> Founder, Chief Developer
> PHPBeginner.com (Where PHP Begins)
> maxim@phpbeginner.com
> www.phpbeginner.com
>
>
>
> -----Original Message-----
> From: David Robley [mailto:huntsman@www.nisu.flinders.edu.au]
> Sent: Friday, August 10, 2001 12:34 PM
> To: Chris; PHP (E-mail)
> Subject: Re: [PHP] Sorting Dates in this format: Jul 21 2001
>
> On Tue, 7 Aug 2001 19:39, Chris wrote:
> > I have a bunch of dates like this:
> > Jul 24 2001
> > Jul 31 2001
> > Aug 7 2001
> >
> > I need to sort it from oldest to newest, but I can't devise a way
> > that works. And they are text fields in MySQL so that won't sort it
> > correctly either. Can anyone point me in the right direction?
>
> Two possible ways - one is to use Mysql date functions to create a
> sortable field and order your query by that field.
>
> Or convert them to Unix timestamp with PHP using strtotime, then sort
> and display using date. The former would be preferable.
Isn't that what I said? Or did I misunderstand myself :-)
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
Waiter, there's no fly in my soup! - Kermit