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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:38:57+00:00 2026-05-19T00:38:57+00:00

Suppose the target time is 4.30 pm and the current time is 3.25 pm

  • 0

Suppose the target time is 4.30 pm and the current time is 3.25 pm , how will i calculate the minutes remaining to reach the target time ? I need the result in minutes.

session_start();
$m=30;
//unset($_SESSION['starttime']);
if(!$_SESSION['starttime']){
   $_SESSION['starttime']=date('Y-m-d h:i:s');
}
$stime=strtotime($_SESSION['starttime']);
$ttime=strtotime((date('Y-m-d h:i:s',strtotime("+$m minutes"))));-->Here I want to calcuate the target time; the time is session + 30 minutes. How will i do that
echo round(abs($ttime-$stime)/60);

Krishnik

  • 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-19T00:38:58+00:00Added an answer on May 19, 2026 at 12:38 am

    A quick calculation of the difference between two times can be done like this:

      $start = strtotime("4:30");
      $stop = strtotime("6:30");
      $diff = ($stop - $start); //Diff in seconds
      echo $diff/3600; //Return 2 hours. Divide by something else to get in mins etc.
    

    Edit*
    Might as well add the answer to your problem too:

    $start = strtotime("3:25");
    $stop = strtotime("4:30");
    $diff = ($stop - $start);
    echo $diff/60; //Echoes 65 min
    

    Oh and one more edit:) If the times are diffent dates, like start is 23:45 one day and end is 0:30 the next you need to add a date too to the strtotime.

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

Sidebar

Related Questions

Suppose I have this annotation @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) public @interface Name { String value(); }
How to get size of a mysql database? Suppose the target database is called
Suppose I wanted to target a specific few Android devices (e.g. tablet), is there
Suppose that you need to have a series of complex configuration for a series
Suppose I have several javascript object {type:gotopage,target:undefined} {type:press,target:a} {type:rotate,target:long} How can I add this
Suppose I have: public class foobar { public int lorem; public int ipsum; }
Suppose we have the following table data: ID parent stage submitted 1 1 1
Suppose I have an IEnumerable such as a List(TValue) and I want to keep
Suppose, in MATLAB, that I have a matrix, A, whose elements are either 0
Suppose I have string Name and Image Photo as properties of a class in

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.