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 8560637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:19:17+00:00 2026-06-11T16:19:17+00:00

say i have a date which is $future_time_ending = 2012-09-21 12:12:22 How do i

  • 0

say i have a date which is

$future_time_ending = "2012-09-21 12:12:22"

How do i work out the number of minutes between the current time and the $future_time_ending?

Thanks

  • 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-06-11T16:19:18+00:00Added an answer on June 11, 2026 at 4:19 pm

    One method:

    $minutes = (strtotime("2012-09-21 12:12:22") - time()) / 60;
    

    strtotime converts the date to a Unix timestamp – the number of seconds since the Unix epoch. Subtract the current timestamp and you have the number of seconds between the current time and the future time. Divide by 60 and the result is in minutes.

    If you don’t know for certain the time you’re comparing is in the future, take the absolute value to get a positive number:

    $minutes = abs(strtotime("2012-09-21 12:12:22") - time()) / 60;
    

    Just to be complete in my answer, there is a more elaborate OO approach available in PHP:

    $time = new DateTime("2012-09-21 12:12:22");
    $diff = $time->diff(new DateTime());
    $minutes = ($diff->days * 24 * 60) +
               ($diff->h * 60) + $diff->i;
    

    This is especially useful if the input time is from a time zone other than the server’s.

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

Sidebar

Related Questions

Say I have a Date, or a Phone number, or some Class which I
Say I have a table which I query like so: select date, value from
All, I have been trying to work out how to select say 15 tickets
I have scrit which makes revision date from current date to 2 or x
say i have a variable integer of 3000 Which equates to 3000 minutes ,
let say i have the following xml file <Users> <User> <Name>David</Name> <Date>9/30/2012 10:52:00 PM</Date>
Let's say I have a date that I can represent in a culture-invariant format
Say I have the following code: struct date { int day; int month; int
Say I have the following simple java bean: class MyBean { private Date startDate;
Lets say I have a table: -------------------------------------- | ID | DATE | GROUP |

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.