SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: date sorting

  1. #1
    SitePoint Guru
    Join Date
    Apr 2001
    Location
    BC, Canada
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    date sorting

    How could I use sort a selection by date? the date consists of hte month, year, and day

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ,,,

  3. #3
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use timestamps to sort dates. You can create a timestamp from the data you have (day, month, year) using mktime() and then you can convert back from a timestamp into a date using date(). http://au.php.net/manual/en/ref.datetime.php

    If the values are being stored in a MySQL database, then you could use the mysql data type timestamp to store the values there to.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •