Find posts within a date range

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • waltercat
    Senior Member
    • Oct 2005
    • 202

    Find posts within a date range

    I simply want to find all posts during a date range. For example find all posts between July 15 and August 15, 2007.

    Or Find all posts within the last month.

    Is there anyway to do this via the frontend, admincp or even the database?

    The database doesn't use dates, so I'm not sure how to search those numbers.
  • Dilly
    Senior Member
    • Mar 2005
    • 1812

    #2
    Dates are stored in Unix Time Format, meaning you need to change your search dates to Unix Time Formats as well. You can do this using this tool: http://www.onlineconversion.com/unix_time.htm

    And you then just do a simple compare on those dates in the database.

    Not sure of the table structure but youd use something like:
    SELECT * FROM PREFIX_posts WHERE posttime > 1184457600 AND posttime < 1187136000;

    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...
    😀
    😂
    🥰
    😘
    🤢
    😎
    😞
    😡
    👍
    👎