import time
current_time = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
print('当前时间记录:', current_time)
当前时间记录: 2020-11-03 22:58:20
import time
logmsg_in = '{} [{}]
'.format(current_time, 'success/error')
print('日志时间记录:', logmsg_in)
日志时间记录: 2020-11-03 22:57:55 [success/error]