UNPKG

@pushrocks/smarttime

Version:

handle time in smart ways

52 lines (51 loc) 1.53 kB
/** * TimeStamp * smart timestamp */ export declare class TimeStamp { /** * returns new TimeStamp from milliseconds */ static fromMilliSeconds(milliSecondsArg: number): TimeStamp; /** * returns new TimeStamp for now with change set * @param timeStampArg */ static fromTimeStamp(timeStampArg: TimeStamp): TimeStamp; /** * The standard JavaScript Date */ date: Date; /** * The time as linux time (milliseconds, not seconds though) * good for comparison */ milliSeconds: number; /** * The standard epoch time in seconds */ epochtime: number; /** * if derived from another TimeStamp points out the change in milliseconds */ change: number; constructor(creatorArg?: number); /** * returns a boolean for wether the timestamp is older than another timestamp * @param TimeStampArg * @param tresholdTimeArg */ isOlderThanOtherTimeStamp(TimeStampArg: TimeStamp, tresholdTimeArg?: number): boolean; /** * Is the current instance older than the argument * @param TimeStampArg */ isOlderThan(TimeStampArg: TimeStamp, tresholdTimeArg?: number): boolean; /** * returns a boolean for wether the timestamp is younger than another timestamp * @param TimeStampArg * @param tresholdTimeArg */ isYoungerThanOtherTimeStamp(TimeStampArg: TimeStamp, tresholdTimeArg?: number): boolean; isYoungerThanMilliSeconds(millisecondArg: number): boolean; }