diff --git a/src/content/doc-surrealql/functions/database/time.mdx b/src/content/doc-surrealql/functions/database/time.mdx index 1a4887670..c2eee4901 100644 --- a/src/content/doc-surrealql/functions/database/time.mdx +++ b/src/content/doc-surrealql/functions/database/time.mdx @@ -143,6 +143,14 @@ time::yday(); time::from::unix() Calculates a datetime based on the seconds since January 1, 1970 0:00:00 UTC. + + time::from::ulid() + Calculates a datetime based on the ULID. + + + time::from::uuid() + Calculates a datetime based on the UUID. + @@ -646,4 +654,40 @@ RETURN time::from::unix(1000); d"1970-01-01T00:16:40Z" ``` -

+
+ +## `time::from::ulid` + +The `time::from::ulid` function calculates a datetime based on the ULID. + +```surql title="API DEFINITION" +time::from::ulid(ulid) -> datetime +``` + +The following example shows this function, and its output, when used in a [`RETURN`](/docs/surrealql/statements/return) statement: + +```surql +RETURN time::from::ulid("01JH5BBTK9FKTGSDXHWP5YP9TQ"); + +d'2025-01-09T10:57:03.593Z' +``` + +
+ +## `time::from::uuid` + +The `time::from::uuid` function calculates a datetime based on the UUID. + +```surql title="API DEFINITION" +time::from::uuid(uuid) -> datetime +``` + +The following example shows this function, and its output, when used in a [`RETURN`](/docs/surrealql/statements/return) statement: + +```surql +RETURN time::from::uuid(u'01944ab6-c1e5-7760-ab6a-127d37eb1b94'); + +d'2025-01-09T10:57:58.757Z' +``` + +