Class SpannerDate (7.5.0) Stay organized with collections Save and categorize content based on your preferences.
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 will be interpreted as local time.
To represent an absolute point in time, useSpanner.timestamp().
Inheritance
Date >SpannerDatePackage
@google-cloud/spannerExample
Spanner.date('3-3-1933');Constructors
(constructor)(dateString)
constructor(dateString?:string);Constructs a new instance of theSpannerDate class
| Parameter | |
|---|---|
| Name | Description |
dateString | string |
(constructor)(year, month, date)
constructor(year:number,month:number,date:number);Constructs a new instance of theSpannerDate class
| Parameters | |
|---|---|
| Name | Description |
year | number |
month | number |
date | number |
Methods
toJSON()
toJSON():string;Returns the date in ISO date format.YYYY-MM-DD
| Returns | |
|---|---|
| Type | Description |
string | {string} |
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 2025-10-30 UTC.