Index

Constructors

constructor

  • new Timestamp ( seconds number ,  nanoseconds number ) : Timestamp
  • Parameters

    • seconds: number
    • nanoseconds: number

    Returns Timestamp

Properties

nanoseconds

nanoseconds: number

seconds

seconds: number

Methods

isEqual

  • isEqual ( other Timestamp ) : boolean
  • Parameters

    Returns boolean

    true if this Timestamp is equal to the provided one.

toDate

  • toDate ( ) : Date
  • Returns Date

    JavaScript Date object representing the same point in time as this Timestamp, with millisecond precision.

toMillis

  • toMillis ( ) : number
  • Returns number

    The point in time corresponding to this timestamp, represented as the number of milliseconds since Unix epoch 1970-01-01T00:00:00Z.

valueOf

  • valueOf ( ) : string
  • Returns string

Static fromDate

  • fromDate ( date Date ) : Timestamp
  • Parameters

    • date: Date

    Returns Timestamp

    A new Timestamp representing the same point in time as the given date.

Static fromMillis

  • fromMillis ( milliseconds number ) : Timestamp
  • Parameters

    • milliseconds: number

    Returns Timestamp

    A new Timestamp representing the same point in time as the given number of milliseconds.

Static now

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

Last updated 2022-07-27 UTC.