mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-28 18:12:05 +08:00
6d316f2bc7
date: 2024-06-11T01:36:39 master commit: f8cb04e4a8b032b72a909f68b808a50936184bee
16 lines
461 B
Python
16 lines
461 B
Python
import datetime
|
|
from pathlib import Path
|
|
|
|
_MIN_DATE = datetime.datetime(year=2024, month=3, day=30)
|
|
|
|
def min_date():
|
|
# on systemd systems, the default time is the systemd build time
|
|
systemd_path = Path("/lib/systemd/systemd")
|
|
if systemd_path.exists():
|
|
d = datetime.datetime.fromtimestamp(systemd_path.stat().st_mtime)
|
|
return d + datetime.timedelta(days=1)
|
|
return _MIN_DATE
|
|
|
|
def system_time_valid():
|
|
return datetime.datetime.now() > min_date()
|