0

I'm trying to retrieve time variable from mySQL database using python. Below shows the python code I use to retrieve the time variable from mySQL database.

import mysql.connector
import time
import datetime

con = mysql.connector.connect(user='root',password='root',host='localhost',database='RV_Aquarium')

cur = con.cursor()

cur.execute("select Feed_Time from ActuatorsLog  ")

results = cur.fetchall()
delta = results[0]
print delta

cur.close()

I able to retrieve the data but it is in the format as shown below enter image description here

I want to convert the retrieve data in the format, for example 19:00:00. Can someone help me on how to convert from (datetime.timedelta(0, 68400),) to 19:00:00 format in python?

Below shows my database data ,

enter image description here

Wondercricket
  • 7,651
  • 2
  • 39
  • 58
Thiyraash David
  • 304
  • 2
  • 12

0 Answers0