simplify timestamp conversion in systemd journal reader;

also handle DST flag correct, so doesn't mistakenly consider the UTC timestamp as local timestamp, see #2882
This commit is contained in:
Sergey G. Brester 2026-04-10 16:44:43 +02:00 committed by GitHub
parent 0a8356dd31
commit 732dc86ef3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -301,7 +301,7 @@ class FilterSystemd(JournalFilter): # pragma: systemd no cover
date = logentry.get('_SOURCE_REALTIME_TIMESTAMP')
if date is None:
date = logentry.get('__REALTIME_TIMESTAMP')
return (date.isoformat(), time.mktime(date.timetuple()) + date.microsecond/1.0E6)
return (date.isoformat(), date.timestamp())
##
# Format journal log entry into syslog style