PHP Classes

PHP Date and Time Ago: Spell a given time difference using English words

Recommend this page to a friend!
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 148 This week: 1All time: 9,101 This week: 560Up
Version License PHP version Categories
php-date-time-ago 1.0.0Custom (specified...5PHP 5, Time and Date
Description 

Author

This class can spell a given time difference using English words.

It takes a given date and time as a timestamp number value or another format and computes the difference of time between now and the given time.

The class returns a string spelling how much time it passed in English.

Picture of sassi souid
  Performance   Level  
Name: sassi souid <contact>
Classes: 1 package by
Country: Tunisia Tunisia
Age: 44
All time rank: 427314 in Tunisia Tunisia
Week rank: 411 Up2 in Tunisia Tunisia Up

Example

<?php
require('DateTimeAgo.php'); //required class file
           
$req=new DateTimeAgo;
            
$time='1525697422';//Timestamp for example
            
$lang='english';//Language for example
           
echo $req->__convert($time,$lang);


Details

PHP-time-ago-class

Feature

- php class to convert timestamp in human readable form - calculate execution time of php script - you can add multiple languages - normal date and time

Description

This php class can detect the time difference between now and one old second,minute,hour,day, month or years. It takes the date of one day and computes the number of seconds between that day and now. The class returns one string that spells the difference of time between the dates.

Example:

<?php require('DateTimeAgo.php'); //required class file

		$req=new DateTimeAgo;
         $time='1525697422';
         $lang='english';
		echo $req->__convert($time,$lang);
		?> 


  Files folder image Files  
File Role Description
Files folder imagePhpDateTimeAgo (3 files)
Accessible without login Plain text file LICENSE Lic. LICENSE

  Files folder image Files  /  PhpDateTimeAgo  
File Role Description
  Plain text file DateTimeAgo.php Class php class to convert timestamp in human readable form
  Accessible without login Plain text file example.php Example how to use
  Accessible without login Plain text file readme.md Doc. documentation

 Version Control Unique User Downloads Download Rankings  
 0%
Total:148
This week:1
All time:9,101
This week:560Up