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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:34:32+00:00 2026-06-01T17:34:32+00:00

In looking at the MySQL documentation, I am not finding an option under DATE_FORMAT

  • 0

In looking at the MySQL documentation, I am not finding an option under DATE_FORMAT (referenced by TIME_FORMAT) for converting a MySQL TIME value (ex: 172:04:11) to something like, “7 days, 4 hours”.

Is there a way (in MySQL) to format time in this manner? Or should I just operate on the returned TIME value in PHP?

  • 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-01T17:34:34+00:00Added an answer on June 1, 2026 at 5:34 pm

    I hate having to answer my own question, but to clear things up MySQL’s TIME() function truncates values over 838:59:59 – obviously not desirable.

    The solution I found was to use this:

    TIMESTAMPDIFF(SECOND,date_old,date_newer) 
    

    Which does not have the same truncation problem. Once you have the seconds use some server side scripting to format the time as in my original request. Reply if you want to see an example in PHP, or write your own. 🙂

    Hope this is helpful?

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

Sidebar

Related Questions

I'm looking at this documentation http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_maketime And I KNOW I must be missing it,
I have a MySQL table looking like this. It's basically a time sheet for
Hi there i'm playing with stmt for the first time (looking at converting my
I'm looking at the MySQL docs and trying to sort out the distinction between
I'm looking for a MySQL equivalent of what str_replace is for PHP. I want
I am looking for the MySQL equivalent of CONTEXT_INFO that is present in SQL
I was just looking at the MySql database created by drupal after I installed
I have a MySQL table looking like this: > describe books; +---------------+--------------+------+-----+---------+----------------+ | Field
So, looking for a mysql-db-lib that is compatible with py3k/py3.0/py3000, any ideas? Google turned
Looking for a good tutorial on how to update a mysql database using a

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.