convert time in seconds to HH:MM:SS format in MySQL?

You can use MySQL function SEC_TO_TIME().

Example:

SELECT SEC_TO_TIME(2378);

Output is:

00:39:38

 

Related Posts

  • 46
    Use =A1/86400 Where A1 holds the time. Format as hh:mm:ss or whatever you need.   You can also try A1=9084 B1==TEXT(A1/(24*60*60),"hh:mm:ss")
    Tags: format, hh:mm:ss, time, seconds, convert
  • 39
    Syntax: IF(expr,if_true_expr,if_false_expr) MySQL IF function is control flow functions that returns a value based on a condition. The IF function is sometimes referred to as IF ELSE or IF THEN ELSE function. If the expr evaluates to TRUE i.e., expr is not NULL and expr is not 0, the IF…
    Tags: function, returns, select, example, mysql
  • 36
    MySQL LOCATE() returns the position of the first occurrence of a string within a string. Both of these strings are passed as arguments. An optional argument may be used to specify from which position of the string (i.e. string to be searched) searching will start. If this position is not…
    Tags: mysql, select, returns, second, function
  • 33
    Very often we need to extract last 30 days, 7 days data from mysql DB. Here we will show easy way to get the data of given interval. SELECT DATE_FORMAT(create_date, '%m/%d/%Y') FROM mytable WHERE create_date BETWEEN CURDATE() - INTERVAL 30 DAY AND CURDATE() Also note that CURDATE() returns only the DATE…
    Tags: select, mysql, time, returns, datetime
  • 31
    The core logic of a database application is performed through SQL statements, whether issued directly through an interpreter or submitted behind the scenes through an API. The tuning guidelines of this post will help to speed up all kinds of MySQL applications. The guidelines cover SQL operations that read and…
    Tags: select, mysql, sql, time

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: