Class SpannerDate (6.12.0)

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, use Spanner.timestamp() .

Inheritance

Date > SpannerDate

Package

@google-cloud/spanner

Example

  Spanner 
 . 
 date 
 ( 
 '3-3-1933' 
 ); 
 

Constructors

(constructor)(dateString)

  constructor 
 ( 
 dateString 
 ?: 
  
 string 
 ); 
 

Constructs a new instance of the SpannerDate class

Parameter
Name
Description
dateString
string

(constructor)(year, month, date)

  constructor 
 ( 
 year 
 : 
  
 number 
 , 
  
 month 
 : 
  
 number 
 , 
  
 date 
 : 
  
 number 
 ); 
 

Constructs a new instance of the SpannerDate 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}

Design a Mobile Site
View Site in Mobile | Classic
Share by: