ScyllaDB University Live | Free Virtual Training Event
Learn more
ScyllaDB Documentation Logo Documentation
  • Deployments
    • Cloud
    • Server
  • Tools
    • ScyllaDB Manager
    • ScyllaDB Monitoring Stack
    • ScyllaDB Operator
  • Drivers
    • CQL Drivers
    • DynamoDB Drivers
    • Supported Driver Versions
  • Resources
    • ScyllaDB University
    • Community Forum
    • Tutorials
Install
Search Ask AI
ScyllaDB Docs ScyllaDB Node.js Driver API Reference Modules types LocalDate
For AI agents: a documentation index is available at https://nodejs-rs-driver.docs.scylladb.com/v0.7.1/llms.txt. A Markdown version of this page is at https://nodejs-rs-driver.docs.scylladb.com/v0.7.1/api/types/LocalDate.md.

LocalDate¶

types~LocalDate(yearOrDaysSinceEpoch, month, day)

A date without a time-zone in the ISO-8601 calendar system, such as 2010-08-05.

LocalDate is an immutable object that represents a date, often viewed as year-month-day. For example, the value "1st October 2014" can be stored in a LocalDate.

This class does not store or represent a time or time-zone. Instead, it is a description of the date, as used for birthdays. It cannot represent an instant on the time-line without additional information such as an offset or time-zone.

Note that this type can represent dates in the range [-5877641-06-23; 5881580-07-17] while the ES5 date type can only represent values in the range of [-271821-04-20; 275760-09-13]. In the event that year, month, day parameters do not fall within the ES5 date range an Error will be thrown. If you wish to represent a date outside of this range, pass a single parameter indicating the days since epoch. For example, -1 represents 1969-12-31.

Constructor¶

new LocalDate(yearOrDaysSinceEpoch, month, day)

Creates a new instance of LocalDate.

Parameters:
Name Type Description
yearOrDaysSinceEpoch

The year or days since epoch. If days since epoch, month and day should not be provided.

month

Between 1 and 12 inclusive.

day

Between 1 and the number of days in the given month of the given year.

Properties:
Name Type Description
date Date

The date representation if falls within a range of an ES5 data type, otherwise an invalid date.

Source

types/local-date.ts, line 32

Members¶

(readonly) _value

If date cannot be represented yet given a valid days since epoch, track it internally.

Source

types/local-date.ts, line 164

Deprecated

This member is in Datastax documentation, but it seems to not be exposed in the API. Additionally we added a new class member: `value` that always returns days since epoch regardless of the date.

(readonly) date

Date object represent this date.

Source

types/local-date.ts, line 150

(readonly) day

A number between 1 and the number of days in the given month of the given year (value up to 31). May return NaN if cannot be represented as a Date.

Source

types/local-date.ts, line 138

(readonly) month

A number between 1 and 12 inclusive representing the month. May return NaN if cannot be represented as a Date.

Source

types/local-date.ts, line 125

(readonly) value

Always valid amount of days since epoch.

Source

types/local-date.ts, line 176

(readonly) year

A number representing the year. May return NaN if cannot be represented as a Date.

Source

types/local-date.ts, line 112

Methods¶

compare(other)

Compares this LocalDate with the given one.

Parameters:
Name Type Description
other

date to compare against.

Source

types/local-date.ts, line 254

Returns:

0 if they are the same, 1 if the this is greater, and -1 if the given one is greater.

equals()

Returns true if the value of the LocalDate instance and other are the same

Source

types/local-date.ts, line 274

toBuffer()

Gets the bytes representation of the instance.

Source

types/local-date.ts, line 285

toJSON()

Gets the string representation of the instance in the form: yyyy-mm-dd, valid for JSON.

Source

types/local-date.ts, line 322

toString()

Gets the string representation of the instance in the form: yyyy-mm-dd if the value can be parsed as a Date, otherwise days since epoch.

Source

types/local-date.ts, line 300

(static) fromBuffer()

Creates a new instance of LocalDate using the bytes representation.

Source

types/local-date.ts, line 243

(static) fromDate()

Creates a new instance of LocalDate using the year, month and day from the provided local date time.

Source

types/local-date.ts, line 203

(static) fromString()

Creates a new instance of LocalDate using the year, month and day provided in the form: yyyy-mm-dd or days since epoch (i.e. -1 for Dec 31, 1969).

Source

types/local-date.ts, line 218

(static) now()

Creates a new instance of LocalDate using the current year, month and day from the system clock in the default time-zone.

Source

types/local-date.ts, line 189

(static) utcNow()

Creates a new instance of LocalDate using the current date from the system clock at UTC.

Source

types/local-date.ts, line 196

Was this page helpful?

PREVIOUS
Integer
NEXT
ResultStream
  • Create an issue
  • Edit this page

On this page

  • LocalDate
    • Constructor
    • Members
    • Methods
ScyllaDB Node.js Driver
Search Ask AI
  • v0.7.1
    • main
    • v0.7.1
    • v0.6.1
  • Getting Started
  • Statements
    • Executing CQL Statements - Best Practices
    • Unprepared Statements
    • Batch Statements
    • Parameterized queries
  • Fetching Large Result Sets
  • Schema Metadata
  • Topology
  • Replicas
  • Query Tracing
  • Logging
  • Policies
    • Load Balancing
    • Retry Policies
  • Authentication
  • Client Routes (Private Networking)
  • Shutdown
  • Migration Guide
  • API Reference
    • Modules
      • auth
        • AuthProvider
        • Authenticator
        • PlainTextAuthProvider
      • datastax
        • graph
        • search
      • errors
        • ArgumentError
        • AuthenticationError
        • BusyConnectionError
        • DriverInternalError
        • NoHostAvailableError
        • NotSupportedError
        • OperationTimedOutError
        • ResponseError
      • geometry
      • mapping
        • DefaultTableMappings
        • Mapper
        • ModelBatchItem
        • ModelMapper
        • Result
        • UnderscoreCqlToCamelCaseMappings
        • TableMappings
      • metrics
        • DefaultMetrics
        • ClientMetrics
      • policies
        • addressResolution
          • AddressTranslator
          • EC2MultiRegionTranslator
          • MappingAddressTranslator
        • loadBalancing
          • AllowListPolicy
          • DCAwareRoundRobinPolicy
          • DefaultLoadBalancingPolicy
          • LegacyDefaultLoadBalancingPolicy
          • LoadBalancingConfig
          • LoadBalancingPolicy
          • RoundRobinPolicy
          • TokenAwarePolicy
        • reconnection
          • ConstantReconnectionPolicy
          • ExponentialReconnectionPolicy
          • ReconnectionPolicy
        • retry
          • FallthroughRetryPolicy
          • RetryPolicy
        • timestampGeneration
          • MonotonicTimestampGenerator
          • TimestampGenerator
      • tracker
        • RequestLogger
        • RequestTracker
      • types
        • BigDecimal
        • Duration
        • InetAddress
        • Integer
        • LocalDate
        • ResultStream
        • Row
        • TimeUuid
        • Tuple
        • Uuid
    • Classes
      • Client
      • ColumnInfo
      • ConstantSpeculativeExecutionPolicy
      • DateRange
      • DateRangeBound
      • DseGssapiAuthProvider
      • DsePlainTextAuthProvider
      • Edge
      • Element
      • Encoder
      • EncoderMembers
      • ExecutionOptions
      • ExecutionProfile
      • FrameReader
      • FrameWriter
      • GraphResultSet
      • HashSet
      • LineString
      • NoSpeculativeExecutionPolicy
      • Path
      • Point
      • Polygon
      • PreparedInfo
      • Property
      • ResultColumnsCache
      • ResultSet
      • RustResult
      • RustSession
      • SpeculativeExecutionPolicy
      • SslOptions
      • Token
      • TokenRange
      • Vertex
      • VertexProperty
      • module-metadata-LocalStrategy
    • Interfaces
    • Events
    • Global Functions and Constants
Docs Tutorials University Contact Us About Us
© 2026 ScyllaDB | Terms of Service | Privacy Policy | ScyllaDB, and ScyllaDB Cloud, are registered trademarks of ScyllaDB, Inc.
Last updated on 23 Oct 2026.
Powered by Sphinx 9.1.0 & ScyllaDB Theme 1.9.3