Function: time.parse

Parses the given RFC 3339-compatible string into a timestamp.

Arguments

Arguments
value

string

A string formatted according to the subset of ISO 8601 defined byRFC 3339 section 5.6, with up to a microsecond precision.

Returns

The timestamp corresponding to the string, as a floating point number inseconds since epoch.

Raised exceptions

Exceptions
TypeErrorIftime is not a string.
ValueErrorIftime is not compatible withRFC 3339 section 5.6.

Examples

# Parse given RFC 3339-compatible string into a timestamp# For example, returns `1715169660`-returnStep:return:${time.parse("2024-05-08T12:01:00.000000Z")}

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.