@technobuddha > library > Time > Relative Time
Function: relativeTime()
ts
function relativeTime(
input: Date,
relativeTo: Date,
options: RelativeTimeOptions): string;Defined in: relative-time.ts:34
Describe the difference between two dates in a simple format
Parameters
| Parameter | Type | Description |
|---|---|---|
input | Date | The date |
relativeTo | Date | The date to compare to |
options | RelativeTimeOptions | see RelativeTimeOptions |
Returns
string
string describing the time difference between the two dates