PHP Classes

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

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 98 All time: 9,836 This week: 673Up
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 <contact>
Classes: 52 packages by
Country: Pakistan Pakistan
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 (4)  
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 (4)  /  class  
File Role Description
  Plain text file Formats.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:98
This week:0
All time:9,836
This week:673Up