MySQL Forums
Forum List  »  Newbie

timediff
Posted by: Wayne Rasmussen
Date: June 06, 2017 07:08PM

If given a starttime, endtime and number, we want to calculate two things:

difference starttime to endtime. Unit time: difference in time/number.

Using current_timestamp(6) to set both starttime and endtime.

Now timediff seems to need to be inserted into a varchar and not a date type field.

Is current_timestamp the wrong thing to use here? Should I get the time in milliseconds so the difference in milliseconds can be used for unit time calculation? Is there a way to get the time in pure milliseconds (like internet time on unix systems).

What should the timediff type be? Is there a table of functions to return type?

Options: ReplyQuote


Subject
Written By
Posted
timediff
June 06, 2017 07:08PM
June 06, 2017 09:38PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.