This is a set of libraries and helpers that I use in all my projects so I thought it was about time to centralize it all and also share it…
- text_formatting – Make a MySQL DATETIME stamp look a little nicer!
This will take a MySQL DATETIME stamp or whatever and will format it.
- If the date+time is within the last few minuets it will return ‘Just now! (2:30pm)’
- If the date+time was today it will return ‘Today’
- If the date+time was yesterday it will return ‘Yesterday’
- If the date+time is tomorrow it will return Tomorrow ’ . date(“g:ia”, $my_date)
$this->load->library('text_formatting');
//$my_sql_datetime = '2010-10-04 22:25:15';
echo $this->text_formatting->date_special($my_sql_datetime);