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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:14:36+00:00 2026-06-01T18:14:36+00:00

I need to subtract time/day using a mysql query; It is something like 02:00

  • 0

I need to subtract time/day using a mysql query;

It is something like 02:00 in (GMT-1) on saturday – wednesday 00:59 in (GMT+5)

How can I do this with a sql query? and get result like 3 days 7 hours and 1 minutes

edit: both days are of same week

  • 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-01T18:14:37+00:00Added an answer on June 1, 2026 at 6:14 pm

    Assuming the dates for this work, and thanks to @symcbean I could get it to work with TIMEDIFF

    SELECT TIMEDIFF(CONVERT_TZ('2012-04-15 02:00:00', '-01:00', '+05:00'), '2012-04-12 00:59:00');
    

    and for the days hours and minutes:

    SELECT CONCAT(
        FLOOR(HOUR(TIMEDIFF(CONVERT_TZ('2012-04-15 02:00:00', '-01:00', '+05:00'), '2012-04-12 00:59:00')) / 24), ' days ',
        MOD(HOUR(TIMEDIFF(CONVERT_TZ('2012-04-15 02:00:00', '-01:00', '+05:00'), '2012-04-12 00:59:00')), 24), ' hours ',
        MINUTE(TIMEDIFF(CONVERT_TZ('2012-04-15 02:00:00', '-01:00', '+05:00'), '2012-04-12 00:59:00')), ' minutes') as TIMEDIFF;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to subtract two 24-hour time values from 0 to 23 using JQuery.
I can't figure out to animate marginLeft with jQuery. I need it to subtract
I am using the following code to transform a universal time code into something
Is this possible? I return the time that something was posted via PHP function
I need to subtract two 24-hour time values from 0 to 23. For example,
I subtract two dates from each other because I need the time difference between
I have two time values on a page: 8:00 22:30 I need to subtract
I have a table with data exactly like this: ID Heading Description Time Location
I need to subtract 0.5 from number a and set the answer to number
Need a function like: function isGoogleURL(url) { ... } that returns true iff URL

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.