Skip to content

MATCH with neotime.Datetime params on value datetime("2019-10-30T07:54:02.129790999[UTC]") #306

@huumq00731

Description

@huumq00731

Example bug report

Can not MATCH with datetime value: "2019-10-30T07:54:02.129790999[UTC]

Neo4j Version: : 3.5.11 Community
Neo4j Mode: Single instance
Driver version: Python driver 1.7.5
(Python lib: neo4j==1.7.5, neobolt==1.7.15, neotime==1.7.4)
Operating System: Window 10 64bit

Steps to reproduce

  1. Start Neo4j.

  2. Run a query with browser:
    CREATE (t:TEST {update_date:datetime("2019-10-30T07:54:02.129790999[UTC]")})

  3. Run python code

from neo4j import GraphDatabase
from neobolt.security import ENCRYPTION_OFF

driver = GraphDatabase.driver("bolt://127.0.0.1:7687", auth=("neo4j", "mchc2019"), encrypted=ENCRYPTION_OFF)
with driver.session() as session:
    search_query = "MATCH (t:TEST) RETURN t"
    result = session.run(search_query)
    for record in result.records():
        print(record["t"])
        last_date = record["t"].get("update_date")
        
    search_query1 = "MATCH (t:TEST) WHERE t.update_date=$last_date RETURN t"
    result1 = session.run(search_query1, last_date=last_date)
    for record1 in result1.records():
        print(record1["t"])

Expected behavior

Out put is:

<Node id=248 labels={'TEST'} properties={'update_date': neotime.DateTime(2019, 10, 30, 7, 54, 2.129790999, tzinfo=)}>
Have record
<Node id=248 labels={'TEST'} properties={'update_date': neotime.DateTime(2019, 10, 30, 7, 54, 2.129790888, tzinfo=)}>

Actual behavior

Out put is:

<Node id=248 labels={'TEST'} properties={'update_date': neotime.DateTime(2019, 10, 30, 7, 54, 2.129790999, tzinfo=)}>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions