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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:25:52+00:00 2026-05-16T16:25:52+00:00

Simple, eh? -sigh- A function. Two string arguments ( I guess it doesn’t matter

  • 0

Simple, eh? -sigh-

A function. Two string arguments ( I guess it doesn’t matter the type). Returning a string which is the time difference between the arguments. Think about it as a counter at your local CS internet-caffe.

function time_diff($start, $stop) {
    ...
    return $diff;
}

echo "Your time playing CS: " . time_diff('19:37', '00:05') . ". Go home!";

I tried. Just too embarrassed to say how much time I’ve invested in this algorithm.
I can’t change the format (tell me about it!).

If you happen to know a class, a file or a piece of code from the depths of the internets, I’d be happy to make use of it.

“Thanks” you very much.

  • 1 1 Answer
  • 1 View
  • 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-16T16:25:53+00:00Added an answer on May 16, 2026 at 4:25 pm

    You can’t do this correctly unless you know:

    • The timezone.
    • The day associated with those times.

    Once you know that, you can do:

    date_default_timezone_set('timezone here');
    $seconds_diff = strtotime("2010-08-29 $end") - strtotime("2010-08-29 $start");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Simple question - How do I convert a string that has been through parseInt
I basically need a function to check whether a string's characters (each character) is
simple question mainly for simplifying purposes but... currently using var categoryList = []; $('#share').children().each(function()
[edit]sigh... the spam protection here isn't letting me post the links, so I guess
Simple question that we've spent to much time on. We have a server side
Simple question about regexps. I've got String text = foobar1foobar1; And I need to
Simple question: How can I return the field type of a MySQL table. I
Simple ASP.NET application. I have two drop-down controls. On the first-drop down I have
Simple question, but one that I've been curious about...is there a functional difference between
Simple question (I hope): I have a simple two column table, a measurement and

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.