SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Dates

  1. #1
    SitePoint Enthusiast vaiod's Avatar
    Join Date
    Jan 2001
    Location
    Chandler, Arizona
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I need to compare dates and determine if they are older than the present date. The dates I am going to be comparing are in the format

    April 4 2001

    I need to know how to break that string down and compare the three parts seperately. What would be the best approach. I can make an array to convert the April to a 4 but I am not sure how to sepearte the three parts.

  2. #2
    SitePoint Addict kunal's Avatar
    Join Date
    Oct 2000
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $string = "April 4 2001";
    $array = explode(" ",$string);

    result for the above
    $array[1] = April
    $array[2] = 4
    $array[3] = 2001
    i dunno...


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
  •