time left format
Hi,
I was looking over at the Mysql website trying to find out how i could calculate the difference between 2 timestamps.
you know when you go to an auction website they have the days hours minutes and seconds left on the auction.
example : 2 days 14hours 5 min 22 seconds.
this is what i thought would work.
date_format((enddate - startdate ) '%e days %H hours %i min %S seconds' ) as timeleft
any help would be great! thanks.
SitePoint Enthusiast
thanks arakys,
but i'm looking for a Mysql way to do it. I'm sure it can be done just using Mysql.
SitePoint Enthusiast
Oops, sorry about that. I'm not very familiar with MySQL but it seems that it doesn't support a function similar to DateDiff in VB. The only functions available would be those listed here :
http://www.mysql.com/doc/en/Date_and...functions.html
that's where i was looking for a solution but i could not find one.
thanks anyway.
SitePoint Enthusiast
Humm.. what about using the Date_Add() or Date_Sub() functions ?
http://www.databasejournal.com/featu...le.php/2190421
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks