From b35956e07885ff147991c7dfd31039bbea7ca5e0 Mon Sep 17 00:00:00 2001 From: Florian Ludwig Date: Sat, 24 Oct 2020 10:32:10 +0200 Subject: Do not use current time in sparql TIMEZONE Calculating the timezone should use date date and time from the datetime object the timezone is requested from instead from the current time. This makes a difference if the timezone for the given location has changed in the past. In this particular case it is probably not possible as iso 8601 seems not have a method to specify the time zone via a location. --- rdflib/plugins/sparql/operators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rdflib') diff --git a/rdflib/plugins/sparql/operators.py b/rdflib/plugins/sparql/operators.py index 29bdd5c0..228b0c28 100644 --- a/rdflib/plugins/sparql/operators.py +++ b/rdflib/plugins/sparql/operators.py @@ -492,7 +492,7 @@ def Builtin_TIMEZONE(e, ctx): if not dt.tzinfo: raise SPARQLError("datatime has no timezone: %r" % dt) - delta = dt.tzinfo.utcoffset(ctx.now) + delta = dt.utcoffset() d = delta.days s = delta.seconds -- cgit v1.2.1