From 497c319ac9ad106929781adf4add777d9ac59513 Mon Sep 17 00:00:00 2001 From: wangweiye7840 Date: Tue, 23 Jan 2024 13:41:13 +0800 Subject: [PATCH] =?UTF-8?q?database=5Ftools=E5=A2=9E=E6=B7=BBGetTime?= =?UTF-8?q?=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工具v2/database_tools.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/工具v2/database_tools.py b/工具v2/database_tools.py index b63df758..fff6efb5 100644 --- a/工具v2/database_tools.py +++ b/工具v2/database_tools.py @@ -6,6 +6,11 @@ def GetDate(): #获得当前日期 currentdate = str(time.localtime().tm_year)+str(time.localtime().tm_mon).zfill(2)+str(time.localtime().tm_mday).zfill(2) return currentdate #返回当前日期yyyymmdd +def GetTime(): #获得当前时间 + t = time.localtime() + currenttime = f"{t.tm_hour:0>2}{t.tm_min:0>2}{t.tm_sec:0>2}" + return currenttime #返回当前时间hhmmss + def ReadTextFile(filepath): #读取文本格式的文件 with open(filepath,"r",encoding="u8") as f: data = f.read()