From: Graeme B. Davis Date: April 2 1999 4:14pm Subject: Re: MySQL/DBI problem List-Archive: http://lists.mysql.com/mysql/1321 Message-Id: <01be7d23$e9099800$9927253f@norway.corp.us.uu.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Thanks for the quick reply! Is there any function in MySQL to convert x seconds to DD HH:MM:SS format? -graeme >>I don't think I can subtract a DATETIME value from another for some reason. >>The manual says it's supposed to be in the format of DAYS H:M:S > >Sorry, I think I misread your question. I usually just convert to >UNIX_TIMESTAMP, subtract, and get a result in seconds. You can convert >this back to HH:MM:SS with MySQL functions (SEC_TO_TIME) if you like, >or use: > >HH= t / 3600; t -= HH * 3600; >MM= t /60; t -= MM * 60; >SS=t;