Skip to content

Parse simple relative time in human readable format to milliseconds.

License

Notifications You must be signed in to change notification settings

fczbkk/parse-relative-time

Repository files navigation

parseRelativeTime

Parse simple relative time in human readable format to milliseconds.

Documentation

parseRelativeTime

Parse simple relative time in human readable format to milliseconds.

Parameters

  • input string Human readable format of relative time

Examples

parseRelativeTime('2 days');  // --> 172800000
parseRelativeTime('-2 days');
parseRelativeTime('in 2 days');
parseRelativeTime('2 days ago');

Returns (null | number)

Bug reports, feature requests and contact

If you found any bugs, if you have feature requests or any questions, please, either file an issue at GitHub or send me an e-mail at riki@fczbkk.com.

License

parseRelativeTime is published under the MIT license.

About

Parse simple relative time in human readable format to milliseconds.

Resources

License

Stars

Watchers

Forks

Packages