Now

Now( )
Now( )
Now( )
Now( )
now( )
Not available in this language yet.
Now( )
Not available in this language yet.

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. The transaction’s start time is the same on all nodes that participate in the transaction. 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:

Value result = await client.Query(
  Now()
);

IResult<Value> data = result.To<Value>();
data.Match(
  Success: value => Console.WriteLine($"{value}"),
  Failure: error => Console.WriteLine($"Query failed:\n{error}")
);
result, err := client.Query(
  f.Now())

if (err != nil) {
  fmt.Println(err)
} else {
  fmt.Println(result)
}
System.out.println(
    client.query(
        Now()
    ).get()
);
client.query(
  q.Now()
).then((ret) => console.log(ret))
print(client.query(
  q.now()
))
println(Await.result(
  client.query(
    Now()
  ),
  5.seconds
))
Not available in this language yet.
Not available in this language yet.
FaunaTime(2020-01-09T21:40:54.406Z)
{500861000 63715757378 <nil>}
2019-10-02T19:34:56.789012Z
Time("2019-10-02T19:34:56.789012Z")
FaunaTime('2020-01-27T21:33:13.631869Z')
2019-10-02T19:34:56.789012Z

Was this article helpful?

We're sorry to hear that.
Tell us how we can improve! documentation@fauna.com

Thank you for your feedback!