PHP date ranges

Discussion in 'OT Technology' started by purebad, Apr 24, 2007.

  1. purebad

    purebad I don't need your approval, right?

    Joined:
    Aug 25, 2006
    Messages:
    4,376
    Likes Received:
    0
    Location:
    Smyrna, GA
    so I am entering a range of dates, in the form of mm/dd/yyyy in a form, then I want to read lines of a file that have a date, and I want to see if the date for a line is in the range. I know I can do it by spliting the date of the line on the /'s and comparing month, then day, then year, but is there a quick way in php to compare dates while in a mm/dd/yyyy form?
     
  2. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
  3. crazybenf

    crazybenf Active Member

    Joined:
    Nov 14, 2001
    Messages:
    15,575
    Likes Received:
    2
    I've always found it best to convert to epoch for all time calculations.

    What difference is 2 lines of code if it guarantees accuracy?
     
  4. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    strtotime does convert to epoch :mamoru:
     
  5. crazybenf

    crazybenf Active Member

    Joined:
    Nov 14, 2001
    Messages:
    15,575
    Likes Received:
    2
    Didnt even read your post. :o
     

Share This Page