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

  • SEARCH
  • Home
  • 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 6254501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:11:25+00:00 2026-05-24T14:11:25+00:00

I see there are other posts on this question in other languages, but I

  • 0

I see there are other posts on this question in other languages, but I can’t find one for PHP. I’m not looking for the difference between two date times, but rather how many days different. For example:

2011-08-06 14:05:28

and

2011-08-07 08:46:28

are less then one day apart, but I want a function that will tell me they are on days that are one day apart, i.e. will return a value of 1 for these two dates, and return a value of 2 for the following dates, for example:

2011-08-06 23:05:28

and

2011-08-08 01:46:28

Really, I’m guessing it must be easy, but I’ve not worked much with dates before.

Oh, and one more constraint, I need something compatible with PHP 5.2, so can’t use DateTime::diff.

EDIT: changed to clarify that I do really need a numeric return value, sorry 🙂

  • 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-24T14:11:26+00:00Added an answer on May 24, 2026 at 2:11 pm

    if i interpret the question correctly, you need GregorianToJD or mysql to_days

    Both functions return a julian day for a specific date, which is basically the number of days since “day 0”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this is a basic question, but I can't find other StackOverflow posts
I see there is a question here but there is no definite answer. Has
I see there is version 1.5 and 3.0 beta , but I can't seem
I see there is a API call for Frienships/Show, but I am not sure
I know, there are several posts with nearly the same question, but all the
Yes I know there has been similar posts to this however after looking through
I've checked the other posts, but non seem to answer my question, so here
I see there are techniques available to have deep models in Backbone, but how
I see there are several posts regarding Cannot set Property and I'm still struggling
I see there are BN_CLICKED and BN_DBLCLK notification messages for a button control. but

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.