Compare commits

..

2 Commits

Author SHA1 Message Date
wangsiyuan fe03bf15df 删除 test.py 2023-09-01 17:54:02 +08:00
wangsiyuan 2b6092e1e6 删除 main.spec 2023-09-01 17:53:26 +08:00
2 changed files with 0 additions and 66 deletions

View File

@ -1,44 +0,0 @@
# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
a = Analysis(
['main.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='main',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)

22
test.py
View File

@ -1,22 +0,0 @@
from datetime import datetime
def format_time_string(input_time_str):
try:
# 解析时区时间字符串为datetime对象
dt_object = datetime.strptime(input_time_str, "%a %b %d %H:%M:%S %Z %Y")
# 将datetime对象重新格式化为所需的字符串格式
formatted_time_str = dt_object.strftime("%Y-%m-%d %H:%M:%S")
return formatted_time_str
except ValueError as e:
print("Error: Invalid time format.")
return None
# 测试函数
input_time_str = "Mon Aug 7 09:33:39 BST 2023"
formatted_time = format_time_string(input_time_str)
if formatted_time is not None:
print(formatted_time)