SpannerDate

SpannerDate

Date-like object used to represent Cloud Spanner Dates. DATE types represent a logical calendar date, independent of time zone. DATE values do not represent a specific 24-hour period. Rather, a given DATE value represents a different 24-hour period when interpreted in a different time zone. Because of this, all values passed to Spanner.date will be interpreted as local time.

To represent an absolute point in time, use Spanner.timestamp.

Constructor

new SpannerDate(dateopt, monthopt, dateopt)

Parameters:
Name Type Attributes Description
date string | number <optional>

String representing the date or number representing the year. If year is a number between 0 and 99, then year is assumed to be 1900 + year.

month number <optional>

Number representing the month (0 = January).

date number <optional>

Number representing the date.

See:
Example
Spanner.date('3-3-1933');

Extends

  • Date

Methods

toJSON() → {string}

Returns the date in ISO date format. YYYY-[M]M-[D]D