mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-05 04:41:20 +00:00
c98eac9c59
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com>
14 lines
322 B
Python
Executable File
14 lines
322 B
Python
Executable File
#!/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))
|