mirror of
https://github.com/borgbackup/borg.git
synced 2026-03-29 05:44:17 -04:00
Merge pull request #3734 from milkey-mouse/fix-3548
Use same datetime object for {now} and {utcnow}, fixes #3548
This commit is contained in:
commit
81c3018787
1 changed files with 3 additions and 3 deletions
|
|
@ -180,14 +180,14 @@ def format_line(format, data):
|
|||
def replace_placeholders(text):
|
||||
"""Replace placeholders in text with their values."""
|
||||
from ..platform import fqdn
|
||||
current_time = datetime.now()
|
||||
current_time = datetime.now(timezone.utc)
|
||||
data = {
|
||||
'pid': os.getpid(),
|
||||
'fqdn': fqdn,
|
||||
'reverse-fqdn': '.'.join(reversed(fqdn.split('.'))),
|
||||
'hostname': socket.gethostname(),
|
||||
'now': DatetimeWrapper(current_time.now()),
|
||||
'utcnow': DatetimeWrapper(current_time.utcnow()),
|
||||
'now': DatetimeWrapper(current_time.astimezone(None)),
|
||||
'utcnow': DatetimeWrapper(current_time),
|
||||
'user': uid2user(os.getuid(), os.getuid()),
|
||||
'uuid4': str(uuid.uuid4()),
|
||||
'borgversion': borg_version,
|
||||
|
|
|
|||
Loading…
Reference in a new issue