A depressing mistake in python

import time
import re
def date_form(t):

    print(t)
    time_list=[]
    for i in range(0,len(t)):

        if "" in t[i]:

            t[i] = re.findall(u"(\d+)", t[i])[0]
            t[i] = time.time() - int(t[i]) * 60 * 60
            t[i] = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(t[i]))
            time_list.append(t[i])
        elif "" in t[i]:

            t[i] = re.findall(u"(\d+)", t[i])[0]
            t[i] = time.time() - int(t[i]) * 60
            t[i] = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(t[i]))
            time_list.append(t[i])
        elif "" in t[i]:

            t[i] = re.findall(u"(\d+)", t[i])[0]
            t[i] = time.time() - int(t[i]) * 24 * 60 * 60
            t[i] = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(t[i]))
            time_list.append(t[i])

        elif str(t[i]).isdigit():
            print("ssss")

            if len(str(t[i])) > 11:

                t[i] = t[i] / 1000
            timeStamp = int(t[i])
            timeArray = time.localtime(timeStamp)
            otherStyleTime = time.strftime("%Y-%m-%d %H:%M:%S", timeArray)
            time_list.append(otherStyleTime)
        else:

            time_list.append("2018" + t[i])

    return time_list

the error report is as follows:
[1535954445401535953235231153594816492415359470783451535946133227153594404109715359436065261535943987715359426095491535940174215359392808741535939033047]
argument of type"

problem description

the environmental background of the problems and what methods you have tried

related codes

/ / Please paste the code text below (do not replace the code with pictures)

what result do you expect? What is the error message actually seen?

May.22,2021

t [I] is an integer and cannot be traversed, so it can be changed to str (t [I]).


this program formats 5 days ago as a date. If the passed parameters should be similar to [5 days ago, 7 minutes ago, 8 days ago]

Menu