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

Author

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: 84611 in Pakistan Pakistan
Week rank: 52 Up3 in Pakistan Pakistan Up
Innovation award
Innovation award
Nominee: 6x

Example

<?php

require_once 'class/Formats.php';

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

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


Details

PHP Formats Class

Converts timestamp and bytes in human readable form

Features

  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 readme.md 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  
 100%
Total:98
This week:1
All time:9,810
This week:560Up