tid_model.py
858 Bytes
#!/usr/bin/env python
# @auther : Ylei
# @date : 2019/10/28
# @File : tid_model.py
# @Software : PyCharm
import datetime,random,string
from date_format import strtime_format_msec
#end_dt = "2019-06-26 08:41:41.572"
end_dt = '20191122224116818'
def tid_maker():
return '{0:%Y%m%d%H%M%S%f}'.format(datetime.datetime.now()) + '-' + ''.join(random.sample(string.ascii_letters + string.digits, 11))
# def tid_end_dt(end_dt):
# return strtime_format_msec(end_dt) + '-' + ''.join(random.sample(string.ascii_letters + string.digits, 11))
def tid_end_dt(end_dt):
#print(end_dt)
return end_dt + '-' + ''.join(random.sample(string.ascii_letters + string.digits, 11))
#print(tid_maker('2019-10-28 07:08:57.058'))
#print(''.join(random.sample(string.ascii_letters + string.digits, 11)))
print(tid_end_dt(end_dt))