ToTime

ToTime( value )
ToTime( value )
ToTime( value )
ToTime( value )
ToTime( value )
Not available in this language yet.
Not available in this language yet.
Not available in this language yet.
2015-02-20T06:30:00Z
{0 63560010600 <nil>}

Description

The ToTime function converts a value to a timestamp type, if possible.

Attempting to convert a value to a timestamp which has no timestamp representation results in an "invalid argument" error.

Parameters

Argument Type Definition and Requirements

value

Any

The value to attempt to convert to a timestamp type.

Returns

A timestamp type of value.

Examples

The query below converts the string "2015-02-20T06:30:00Z" to a timestamp.

result, _ := client.Query(ToTime("2015-02-20T06:30:00Z"))
fmt.Println(result)
System.out.println(
        client.query(
                ToTime(Value("2015-02-20T06:30:00Z"))
        ).get());
Not available in this language yet.
Not available in this language yet.
Not available in this language yet.
Not available in this language yet.
Not available in this language yet.
client.query(
  q.ToTime('2015-02-20T06:30:00Z')
)
.then((ret) => console.log(ret))
2015-02-20T06:30:00Z
{0 63560010600 <nil>}

Was this article helpful?

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

Thank you for your feedback!