FQL v4 will be decommissioned on June 30, 2025. Ensure that you complete your migration from FQL v4 to FQL v10 by that date.

For more details, review the migration guide. Contact support@fauna.com with any questions.

Now

This reference topic applies to FQL v4. Go to this page for the latest FQL v10 reference topics.

Now( )
now( )
Now( )
Now( )
Now( )

Description

The Now function constructs a Timestamp representing the transaction’s start time.

Multiple calls to Now within a single transaction produce the same timestamp. During a temporal query, Now still means the transaction’s start time, not the temporal query’s specified timestamp.

Parameters

None.

Returns

A Timestamp which represents the transaction’s start time.

Examples

The following query returns a Timestamp for the transaction’s start time:

client.query(
  q.Now()
)
.then((ret) => console.log(ret))
.catch((err) => console.error(
  'Error: [%s] %s: %s',
  err.name,
  err.message,
  err.errors()[0].description,
))
Time("2019-10-02T19:34:56.789012Z")
result = client.query(
  q.now()
)
print(result)
FaunaTime('2020-01-27T21:33:13.631869Z')
result, err := client.Query(
	f.Now())

if err != nil {
	fmt.Fprintln(os.Stderr, err)
} else {
	fmt.Println(result)
}
{346000000 63739344055 <nil>}
try
{
    Value result = await client.Query(
        Now()
    );
    Console.WriteLine(result);
}
catch (Exception e)
{
    Console.WriteLine($"ERROR: {e.Message}");
}
FaunaTime(2020-10-26T23:56:52.326Z)
Now()
Time("2021-06-21T21:21:27.237Z")
Query metrics:
  •    bytesIn:  12

  •   bytesOut:  47

  • computeOps:   1

  •    readOps:   0

  •   writeOps:   0

  •  readBytes:   0

  • writeBytes:   0

  •  queryTime: 2ms

  •    retries:   0

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!