neo4j / neo4j-browser

Neo4j Browser is the general purpose user interface for working with Neo4j. Query, visualize, administrate and monitor the database.
https://neo4j.com
GNU General Public License v3.0
690 stars 347 forks source link

Datetime function timezone issue when hour is 00 #1919

Closed B-D-T closed 1 year ago

B-D-T commented 1 year ago

Description

The datetime() function appears to have an error when the time is between 12-1am. This does not happen everywhere, however, as it works as expected when using cypher-shell.

Reproduce Steps

Run a query trying to use datetime() to convert a time between midnight and 1:00am.

Expected Behavior

With 1:00 am, the time zone returns as expected (-04:00):

RETURN datetime('2023-05-30T01:00:00[America/New_York]')
// Expected: 2023-05-30T01:00:00-04:00[America/New_York]
// Actual:   2023-05-30T01:00:00-04:00[America/New_York]

Current Behavior

With anything in the 12:00am range, the time zone changes to +20:00:

RETURN datetime('2023-05-30T00:59:00[America/New_York]')
// Expected: 2023-05-30T00:59:00-04:00[America/New_York]
// Actual:   2023-05-30T00:59:00+20:00[America/New_York]

This happens when passing the individual components, too, and only happens with 12-1am. I've tried with several different years and days.

UNWIND range(0, 23) AS hr
RETURN datetime({year:2023, month:5, day:30, hour:hr, minute:0, second:0, timezone:'America/New_York'})
// All correct expect the first hour of the day.

Environment information

OskarDamkjaer commented 1 year ago

Hi! Thanks for debugging and reporting this! It looks very odd and since it works properly in cypher-shell, it's probably something wrong in either Browser or the javascript driver :+1:

B-D-T commented 1 year ago

Confirmed that this is still an issue on Neo4j Desktop v1.5.8 with the following configuration:

I haven't bothered setting up a JavaScript driver connection, so I haven't been able to isolate whether it's a browser issue or a driver issue.

OskarDamkjaer commented 1 year ago

Hello @B-D-T! I forgot to give an update but we did investigate this and found it to be an issue with the driver.

https://github.com/neo4j/neo4j-javascript-driver/issues/1096

I think the fix has since been merged to driver, but we're still behind a few versions on our end