cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Issue with python native driver displaying iso time formats

john1
Node Link

Looking at the neotime python package in init.py I see that the iso_format method for the Time class works differently than the iso_format method for the DateTime class. Specifically, the DateTime.iso_format method will return the timezone information but the Time.iso_format method does not. See below…

From the DateTime class

def iso_format(self, sep="T"):

s = "%s%s%s" % (self.date().iso_format(), sep, self.time().iso_format())

if self.tzinfo is not None:

offset = self.tzinfo.utcoffset(self)

s += "%+03d:%02d" % divmod(offset.total_seconds() // 60, 60)

return s

From the Time class

def iso_format(self):

return "%02d:%02d:%012.9f" % self.hour_minute_second

This seems like a bug to me, I have to code around this in my application since I don’t want to make changes to the neotime init.py file.

0 REPLIES 0
Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online