Skip to content

Provides casual time statements such as "about 10 minutes ago"

License

Notifications You must be signed in to change notification settings

barrydrink/friendly-time

Repository files navigation

License Download Build Status codecov Code Climate Join the chat at https://gitter.im/friendly-time/Lobby

FriendlyTime

Provides casual time strings for events in the past. E.g. "about 10 minutes ago".

To use:

long timeNow = System.currentTimeMillis();
long timeThen = timeNow - 5000;
String friendlyTime = FriendlyTime.getFriendlyTime(timeNow, timeThen));

//friendlyTime has value "seconds ago"

See also the unit tests.

About

Provides casual time statements such as "about 10 minutes ago"

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages