timeAgo

Type:Function
Status:stable
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.datetime

Simple “time” ago for your Unix timestamps and JavaScript Date objects.

Params

  1. timestamp*-Number

    The timestamp to transform

  2. format“‘medium’“‘short’|‘medium’|‘long’

    The format you want back

Return

  1. -String

    The converted value

Example

import { timeAgo } from '@blackbyte/sugar/datetime';
timeAgo(1611344957); // => 7 secs ago

Todo

  • testsnormal