Display Dates between from date to date

Discussion in 'PHP' started by newphpcoder, Feb 13, 2012.

  1. newphpcoder

    newphpcoder New Member

    Joined:
    Sep 24, 2010
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Web Programmer
    Location:
    Philippines
    Hi...
    Good day!
    I have table that has a field from_date and to_date.
    Now I just want to know if how can I display as table format the dates between from_date to_date.
    Like this
    from_date: 2011-12-16
    to_date: 2011-12-31
    I want to display it:
    16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 // table format.
    Thank you
     
  2. pein87

    pein87 Active Member

    Joined:
    Aug 6, 2010
    Messages:
    173
    Likes Received:
    47
    Trophy Points:
    28
    Occupation:
    Web Dev
    Location:
    Limbo
    use the

    Code:
    BETWEEN date AND date 
    in the end

    You can use the YEAR and MONTH functions as well but you need date to be a date type like datetime, date, etc...
     
  3. Alex.Gabriel

    Alex.Gabriel New Member

    Joined:
    Oct 23, 2011
    Messages:
    86
    Likes Received:
    7
    Trophy Points:
    0
    Occupation:
    Linux system administrator
    Location:
    Italy
    Home Page:
    http://blog.evilcoder.net
    Full year or just a defined period ?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice