Compare commits
2 Commits
060fa7eb5e
...
fe03bf15df
| Author | SHA1 | Date |
|---|---|---|
|
|
fe03bf15df | |
|
|
2b6092e1e6 |
44
main.spec
44
main.spec
|
|
@ -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
22
test.py
|
|
@ -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)
|
|
||||||
Reference in New Issue