Compare commits
No commits in common. "fe03bf15df2ab77ff9b1cda4d55f77d62818d13e" and "060fa7eb5ec73bd03b1c54533a9e78ee90249a35" have entirely different histories.
fe03bf15df
...
060fa7eb5e
|
|
@ -0,0 +1,44 @@
|
||||||
|
# -*- 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,
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
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)
|
||||||
Reference in New Issue