datezone
Version:
A lightweight and comprehensive date and timeZone utility library for JavaScript.
59 lines • 2.05 kB
TypeScript
/**
* Start of second.
*
* @param ts - The timestamp in milliseconds
* @returns A new timestamp representing the start of the second
* @see https://datezone.dev/docs/reference/second#startofsecond
*/
export declare function startOfSecond(ts: number): number;
/**
* End of second.
*
* @param ts - The timestamp in milliseconds
* @returns A new timestamp representing the end of the second
* @see https://datezone.dev/docs/reference/second#endofsecond
*/
export declare function endOfSecond(ts: number): number;
/**
* Add seconds.
*
* @param ts - The timestamp in milliseconds
* @param amount - The number of seconds to add (can be negative)
* @returns A new timestamp with the seconds added
* @see https://datezone.dev/docs/reference/second#addseconds
*/
export declare function addSeconds(ts: number, amount: number): number;
/**
* Subtract seconds.
*
* @param ts - The timestamp in milliseconds
* @param amount - The number of seconds to subtract
* @returns A new timestamp with the seconds subtracted
* @see https://datezone.dev/docs/reference/second#subseconds
*/
export declare function subSeconds(ts: number, amount: number): number;
/**
* Add milliseconds.
*
* @param ts - The timestamp in milliseconds
* @param amount - The number of milliseconds to add (can be negative)
* @returns A new timestamp with the milliseconds added
* @see https://datezone.dev/docs/reference/second#addmilliseconds
*/
export declare function addMilliseconds(ts: number, amount: number): number;
/**
* Subtract milliseconds.
*
* @param ts - The timestamp in milliseconds
* @param amount - The number of milliseconds to subtract
* @returns A new timestamp with the milliseconds subtracted
* @see https://datezone.dev/docs/reference/second#submilliseconds
*/
export declare function subMilliseconds(ts: number, amount: number): number;
/**
* Get the second of a timestamp.
*
* @see https://datezone.dev/docs/reference/second#second
*/
export declare function second(ts: number): number;
//# sourceMappingURL=second.pub.d.ts.map