From 3925f7b41799f64cbe0a99acacdc22c4dfc609f8 Mon Sep 17 00:00:00 2001 From: randomJoe211 <69501902+randomJoe211@users.noreply.github.com> Date: Thu, 13 Jan 2022 11:07:35 +0800 Subject: [PATCH] Update 4.date-and-time.md --- .../3.data-types/4.date-and-time.md | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/docs-2.0/3.ngql-guide/3.data-types/4.date-and-time.md b/docs-2.0/3.ngql-guide/3.data-types/4.date-and-time.md index 5249dd35322..c87ea5b20c2 100644 --- a/docs-2.0/3.ngql-guide/3.data-types/4.date-and-time.md +++ b/docs-2.0/3.ngql-guide/3.data-types/4.date-and-time.md @@ -58,24 +58,27 @@ The `TIMESTAMP` data type is used for values that contain both date and time par - Supported `TIMESTAMP` inserting methods: timestamp, `timestamp()` function, and `now()` function. - `timestamp()` function accepts empty parameters to get the timestamp of the current timezone and also accepts a string type parameter. - - ```ngql - # Return the current time. - nebula> RETURN timestamp(); - +-------------+ - | timestamp() | - +-------------+ - | 1625469277 | - +-------------+ - - # Return the specified time. - nebula> RETURN timestamp("2021-07-05T06:18:43.984000"); - +-----------------------------------------+ - | timestamp("2021-07-05T06:18:43.984000") | - +-----------------------------------------+ - | 1625465923 | - +-----------------------------------------+ - ``` + + ```ngql + # Return the current time. + nebula> RETURN timestamp(); + +-------------+ + | timestamp() | + +-------------+ + | 1625469277 | + +-------------+ + + nebula> RETURN timestamp("2022-01-05T06:18:43"); + +----------------------------------+ + | timestamp("2022-01-05T06:18:43") | + +----------------------------------+ + | 1641363523 | + +----------------------------------+ + ``` + + !!! compatibility "Legacy version compatibility" + + In Nebula Graph versions earlier than 3.0.0, the time string passed into the timestamp() function could include milliseconds and microseconds. As of version 3.0.0, the time string passed into the timestamp() function cannot include milliseconds and microseconds. - The underlying storage data type is **int64**.