Home Manual Reference Source Test
import {NanoDate} from 'influx'
public interface | source

NanoDate

Extends:

Date → NanoDate

A NanoDate is a type of Date that holds a nanosecond-precision unix timestamp. It's the default date type parsed in Results and can be created manually using toNanoDate.

Method Summary

Public Methods
public

Returns the unix nanoseconds timestamp as a string.

public

Formats the date as an ISO RFC3339 timestamp with nanosecond precision.

Public Methods

public getNanoTime(): string source

Returns the unix nanoseconds timestamp as a string.

Return:

string

Example:

const date = toNanoDate('1475985480231035677')
expect(date.getNanoTime()).to.equal('1475985480231035677')

public toNanoISOString(): string source

Formats the date as an ISO RFC3339 timestamp with nanosecond precision.

Return:

string

Example:

const date = toNanoDate('1475985480231035677')
expect(date.toNanoISOString()).to.equal('2016-10-09T03:58:00.231035677Z')