Skip to content

tzdata version incompatibility warning #1185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 29 additions & 5 deletions pages/advanced-algorithms/available-algorithms/date.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: date
description: Discover how to effectively perform date-based operations in your graph data with Memgraph's Date class. Also, check out our documentation to learn how to manipulate and better contextualize dates in your data.
description: Discover how to effectively perform date-based operations in your graph data with Memgraph's Date class. Also, check out our documentation to learn how to manipulate and better contextualize dates in your data.
---

import { Steps } from 'nextra/components'
Expand Down Expand Up @@ -60,6 +60,18 @@ The `timezone` parameter can be specified with the database TZ identifier (text)
name, as listed for
[timezones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).

<Callout type="warning">

Starting with `tzdata` version `2024b`, its format has changed and an
incompatibility with the current libstdc++ has been introduced. As a result,
using `tzdata` version `2024b` or later will break the timezone feature in
Memgraph. This could lead to incorrect handling of timezones and unexpected
behavior in your application. To avoid compatibility issues, please ensure that
you are using `tzdata` `v2024a` or earlier with Memgraph until libstdc++ has
been updated to support the new format in tzdata.

</Callout>

{<h4 className="custom-header"> Output: </h4>}

- `formatted: string` ➡ The received time in the specified format.
Expand All @@ -69,7 +81,7 @@ name, as listed for
Use the following query to get a string representation from a time value:

```cypher
CALL date.format(74976, "h", "%Y/%m/%d %H:%M:%S %Z", "Mexico/BajaNorte")
CALL date.format(74976, "h", "%Y/%m/%d %H:%M:%S %Z", "Mexico/BajaNorte")
YIELD formatted RETURN formatted;
```

Expand Down Expand Up @@ -107,6 +119,18 @@ The `timezone` parameter can be specified with the database TZ identifier (text)
name, as listed for
[timezones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).

<Callout type="warning">

Starting with `tzdata` version `2024b`, its format has changed and an
incompatibility with the current libstdc++ has been introduced. As a result,
using `tzdata` version `2024b` or later will break the timezone feature in
Memgraph. This could lead to incorrect handling of timezones and unexpected
behavior in your application. To avoid compatibility issues, please ensure that
you are using `tzdata` `v2024a` or earlier with Memgraph until libstdc++ has
been updated to support the new format in tzdata.

</Callout>

{<h4 className="custom-header"> Output: </h4>}

- `parsed: int` ➡ The number of time units that have elapsed since the Unix epoch.
Expand All @@ -116,7 +140,7 @@ name, as listed for
Use the following query to parse the date string:

```cypher
CALL date.parse("2023/08/03 14:30:00", "h", "%Y/%m/%d %H:%M:%S", "Europe/Zagreb")
CALL date.parse("2023/08/03 14:30:00", "h", "%Y/%m/%d %H:%M:%S", "Europe/Zagreb")
YIELD parsed RETURN parsed;
```

Expand All @@ -134,9 +158,9 @@ Adds two numeric values representing quantities of time in specific units.

{<h4 className="custom-header"> Input: </h4>}

- `time: int` ➡ The first term in the addition operation.
- `time: int` ➡ The first term in the addition operation.
- `unit: string` ➡ The time unit of the above value.
- `add_value: int` ➡ The second term in the addition operation.
- `add_value: int` ➡ The second term in the addition operation.
- `add_unit: string` ➡ The time unit of the above value.

The `unit` parameter supports the following values:
Expand Down
46 changes: 27 additions & 19 deletions pages/fundamentals/data-types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ calling the function `duration()`.
For strings, the duration format is: `P[nD]T[nH][nM][nS]`.

The `n` stands for a number, and the capital letters are used as a separator
with each field in `[]` marked optional.
with each field in `[]` marked optional.

| name | description |
| :--: | :---------: |
Expand All @@ -296,9 +296,9 @@ with each field in `[]` marked optional.
| M | Minutes |
| S | Seconds |

When using strings, only the last filed can be a double, e.g., `P2DT2.5H`.
When using strings, only the last filed can be a double, e.g., `P2DT2.5H`.

Example:
Example:

```cypher
CREATE (:F1Laps {lap: duration("PT2M2.33S")});
Expand All @@ -310,7 +310,7 @@ Maps can contain the following six fields: `day`, `hour`, `minute`, `second`,
`millisecond` and `microsecond`. Every field can be a double, an int or a
mixture of both. Memgraph also supports negative durations.

Example:
Example:

```cypher
CREATE (:F1Laps {lap: duration({minute:2, second:2, microsecond:33})});
Expand Down Expand Up @@ -373,7 +373,7 @@ MATCH (f:F1Laps) RETURN f.lap.second;
### Date

You can create a property of temporal type `Date` from a string or map by
calling the function `Date()`.
calling the function `Date()`.


**String**
Expand All @@ -389,7 +389,7 @@ For strings, the date format is specified by the ISO 8601: `YYYY-MM-DD` or

The lowest year is `0` and the highest is `9999`.

Example:
Example:

```cypher
CREATE (:Person {birthday: date("1947-07-30")});
Expand All @@ -402,7 +402,7 @@ to the current date of the calendar (UTC clock).

For maps, three fields are available: `year`, `month`, `day`.

Example:
Example:

```cypher
CREATE (:Person {birthday: date({year:1947, month:7, day:30})});
Expand All @@ -416,7 +416,7 @@ You can access the individual fields of a date through its properties:
| month | Returns the month field |
| day | Returns the day field |

Example:
Example:

```cypher
MATCH (b:Person) RETURN b.birthday.year;
Expand All @@ -425,7 +425,7 @@ MATCH (b:Person) RETURN b.birthday.year;
### LocalTime

You can create a property of temporal type `LocalTime` from a string or map by
calling the function `localTime()`.
calling the function `localTime()`.

**Strings**

Expand All @@ -438,7 +438,7 @@ or `[T]hh:mm` or `[T]hhmmss` or `[T]hhmm` or `[T]hh`.
| m | Minutes |
| s | Seconds |

Example:
Example:

```cypher
CREATE (:School {Calculus: localTime("09:15:00")});
Expand Down Expand Up @@ -481,25 +481,25 @@ MATCH (s:School) RETURN s.Calculus.hour;

### LocalDateTime

You can create a property of temporal type `LocalDateTime` from a string or map by calling the function `localDateTime()`.
You can create a property of temporal type `LocalDateTime` from a string or map by calling the function `localDateTime()`.
LocalDateTime uses the defined [timezone](#database-timezone) to convert between local and UTC time.

<Callout type="info">

At a lower level, LocalDateTime will use system time (UTC), changing the instance timezone will
change the displayed time point, but will not change the underlying data.
At a lower level, LocalDateTime will use system time (UTC), changing the instance timezone will
change the displayed time point, but will not change the underlying data.
All LocalDateTime is converted to UTC, so comparing time points between different timezones gives the correct result.

</Callout>

<Callout type="warning">

When recovering from pre-2.19 snapshots and WALs, the observed LocalDateTime might change due to the introduction of the timezone.
When recovering from pre-2.19 snapshots and WALs, the observed LocalDateTime might change due to the introduction of the timezone.

Previously LocalDateTime was interpreted and saved as UTC time.
Post 2.19, the displayed LocalDateTime is in the local timezone and gets converted to UTC time.
Post 2.19, the displayed LocalDateTime is in the local timezone and gets converted to UTC time.

Pre 2.19 executing `LocalDateTime()` would return the current UTC time.
Pre 2.19 executing `LocalDateTime()` would return the current UTC time.
Any such saved data is still "correct" post 2.19; timezone will correctly be applied and local time will be displayed.

Executing `LocalDateTime("2024-07-24T13:30:00")` will give different result pre and post 2.19.
Expand Down Expand Up @@ -569,15 +569,23 @@ MATCH (f:Flights) RETURN f.AIR123.year;
`LocalDateTime` uses the set database timezone to properly convert between system time (UTC) and local (user) time.

The timezone can be defined via:
1. `--timezone` command-line argument
1. `--timezone` command-line argument
1. `SET DATABASE SETTING "timezone" TO "Europe/Rome"` query

Both methods use IANA timezone descriptors to specify the timezone. See [list of time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List).

<Callout type="warning">

Starting with `tzdata` version `2024b`, its format has changed and an incompatibility with the current libstdc++ has been introduced.
As a result, using `tzdata` version `2024b` or later will break the timezone feature in Memgraph. This could lead to incorrect handling of timezones and unexpected behavior in your application.
To avoid compatibility issues, please ensure that you are using `tzdata` `v2024a` or earlier with Memgraph until libstdc++ has been updated to support the new format in tzdata.

</Callout>

### ZonedDateTime

You can create a value of the `ZonedDateTime` type from a string or a map by
calling the `datetime()` function.
calling the `datetime()` function.

**Strings**

Expand Down Expand Up @@ -799,7 +807,7 @@ Memgraph supports four Coordinate Reference Systems (CRS) for spatial data, divi

A WGS-84 point consists of longitude, latitude, and height if the point is 3D.
Longitude and latitude are specified in degrees while height is specified in meters.
Longitude has to be in the [-180, 180] range, latitude in the [-90, 90] range and height can be any `Float` value.
Longitude has to be in the [-180, 180] range, latitude in the [-90, 90] range and height can be any `Float` value.

| Point type | SRID | CRS |
| :---------------: | :----------: | :--------: |
Expand Down