Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5845691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:28:15+00:00 2026-05-22T12:28:15+00:00

Any help is highly appreciated. Say I have a MySQL database with a timestamp

  • 0

Any help is highly appreciated.

Say I have a MySQL database with a timestamp column with the value “1305590400”, how can I compare that with a PHP variable of say “2011-05-17”? I want to completely ignore the time part and only compare the date.

At the moment I am trying to get it working with the following but it returns no results:

WHERE  FROM_UNIXTIME('timestamp_column','%Y-%m-%d') = '" . $date. "'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:28:16+00:00Added an answer on May 22, 2026 at 12:28 pm

    You don’t get results that probably $date has some time offset and is not equal to 00:00:00 in your timezone.

    WHERE timestamp_column BETWEEN '" . strtotime($date) . "' AND '" . strtotime($date, '+1 day') . "'
    

    or to be more precise:

        WHERE timestamp_column >= '" . strtotime($date) . "'
          AND timestamp_column < '" . strtotime($date, '+1 day') . "'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any algorithms that can help with hierarchical clustering? Google's map-reduce has only
I have a question about localization how can i do localization lets say that
any help you can give is very gratefully accepted. I've been looking at this
http://localhost/XYZ/Client/(S(enlodz55ov4ncafza0gpp045))/Info/Rates.aspx Does anyway know what /(S(enlodz55ov4ncafza0gpp045))/ means? Any help appreciated.
I really need help with interfaces in general... Any resources that you guys would
Can i get the source code for a WAMP stack installer somewhere? Any help
Say that I have vendors selling various products. So, at a basic level, I
I can't get the the conditional to work in this function, any help? function
If it's any help, there is also a similar class in C#'s WebRequest. Although
Anybody found yet a good web site architecture using linq to sql? Any help

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.