PHP Classes

PHP Format Date and Byte Count: Display timestamps and bytes in a readable form

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: 98 All time: 9,823 This week: 673Up
Version License PHP version Categories
php-formats-class 1.0MIT/X Consortium ...5PHP 5, Time and Date, Text processing


This class can display timestamps and bytes in a readable form.

It can take a given date and time and return it as a string with the amount of time that passed since that time expressed in English.

The class can also take a number of bytes and returns a string that represents it either in terms of B, KB, MB GB, TB or PB.

Picture of Muhammad Umer Farooq
Name: Muhammad Umer Farooq is available for providing paid consulting. Contact Muhammad Umer Farooq .
Classes: 52 packages by
Country: Pakistan Pakistan
Age: 22
All time rank: 84411 in Pakistan Pakistan
Week rank: 280 Up6 in Pakistan Pakistan Up
Innovation award
Innovation award
Nominee: 6x



require_once 'class/Formats.php';

/* Opcache */
$formats = new Formats();

//Usage example
echo $formats->friendlyTime(1541151468);


PHP Formats Class

Converts timestamp and bytes in human readable form


  1. Formats the bytes in human readable form.
  2. Converts the timespam in to human readable form.

  Files folder image Files  
File Role Description
Files folder imageclass (1 file)
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file Doc. Documentation

  Files folder image Files  /  class  
File Role Description
  Plain text file Formats.php Class Class source

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:9,823
This week:673Up