mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-05 12:51:12 +00:00
13 lines
321 B
Python
13 lines
321 B
Python
|
#!/usr/bin/env python3
|
||
|
|
||
|
import os
|
||
|
from datetime import datetime, timezone
|
||
|
|
||
|
timestamp = os.environ.get('SOURCE_DATE_EPOCH', None)
|
||
|
timeformat = '%c %Z'
|
||
|
|
||
|
if timestamp:
|
||
|
print(datetime.fromtimestamp(int(timestamp), tz=timezone.utc).strftime(timeformat))
|
||
|
else:
|
||
|
print(datetime.now(tz=timezone.utc).strftime(timeformat))
|