test01.py
477 Bytes
import time
def getCsvname():
local_time = time.localtime()
# %04d-%02d-%02d %02d:%02d:%02d
strTime = "%04d%02d%02d%02d%02d%02d" % (
local_time.tm_year,
local_time.tm_mon,
local_time.tm_mday,
local_time.tm_hour,
local_time.tm_min,
local_time.tm_sec,
)
return strTime
if __name__ == "__main__":
if " - " == "-":
print("true")
strTime = getCsvname()
print("strTime", strTime)
# end main