tedious
Version:
A TDS driver, for connecting to MS SQLServer databases.
23 lines (22 loc) • 964 B
TypeScript
import type WritableTrackingBuffer from '../tracking-buffer/writable-tracking-buffer';
/**
* A `Date` that may carry the sub-millisecond part of a `time`, `datetime2`
* or `datetimeoffset` value, as the value parser produces it.
*/
export interface TemporalValue extends Date {
nanosecondDelta?: number;
}
/**
* The number of days from 0001-01-01 to the calendar date of `value`.
*/
export declare function daysSinceYearOne(value: Date, useUTC: boolean): number;
/**
* The length in bytes of a `time` value at `scale`, as it prefixes the
* value and pads out the lengths of `datetime2` and `datetimeoffset`.
*/
export declare function timeLength(scale: number | undefined): number;
/**
* Writes the time of day of `value` as the number of 10^-scale second
* intervals since midnight, in `timeLength(scale)` bytes.
*/
export declare function writeTimeOfDay(buffer: WritableTrackingBuffer, value: TemporalValue, scale: number, useUTC: boolean): void;