rymanalu / twitter-time-ago
Displays the date in a "time ago" format like Twitter.
Installs: 73
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/rymanalu/twitter-time-ago
Requires
- php: >=5.4
- nesbot/carbon: ~1.18
Requires (Dev)
- phpunit/phpunit: ~4.8
This package is auto-updated.
Last update: 2025-09-09 17:38:51 UTC
README
This package provides a function to parse a datetime to human readable time difference like Twitter.
Installation
composer require rymanalu/twitter-time-ago
Usage
use Rymanalu\TwitterTimeAgo\TwitterTimeAgo; $timeAgo = new TwitterTimeAgo; // or `new TwitterTimeAgo($timezone)` echo $timeAgo->parse('2016-12-21 12:06:45'); // You can also just pass a date... echo $timeAgo->parse('2016-12-12'); // Using static method... echo TwitterTimeAgo::parse('2016-12-21 12:06:45'); // Using global helper... echo twitter_time_ago($datetime);