Check out v4 of the Fauna CLI

v4 of the Fauna CLI is now in beta.

The new version introduces enhancements to the developer experience, including an improved authentication workflow. To get started, check out the CLI v4 quick start.

time.difference()

Get the difference between two Times.

Signature

difference(start: Time, unit: String) => Number

Description

Get the difference between two times.

Parameters

Parameter Type Required Description

start

Time

true

Time to subtract from instance Time.

unit

String

true

Time units:

nanoseconds
microseconds
milliseconds
seconds
minutes
hours
days

Return value

Type Description

Number

Difference between the provided times, in units rounded to the nearest nanosecond.

Examples

Time('2099-02-10T12:00:00.000Z').difference(Time('2099-02-01T12:00:00.000Z'), 'days')
9

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!