日期字符串python

file_time = os.path.getmtime(chk_path+’/’+line)
file_date = datetime.datetime.fromtimestamp(file_time).strftime(‘%Y%m%d’)

file_time = datetime.datetime.fromtimestamp(file_time)
delta = now – file_time

if delta.days > int(ndays) :

# string to datetime
#
# ts = time.strptime(file_date, “%Y%m%d”)
# Y,m,d,H,M = ts[0:5]
# file_date = datetime.datetime(Y,m,d)
#

Leave a Reply

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