PHP Classes

Incredible Timestamp: Compute the seconds elapsed since the year 0

Recommend this page to a friend!
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog (1)    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 109 All time: 9,506 This week: 174Up
Version License PHP version Categories
m12 1.0.0Custom (specified...5PHP 5, Time and Date
Description Author

This class can compute the seconds elapsed since the year 0.

It takes as parameter an array of date and time elements that include the year, month, day, hour, minutes and seconds.

The class can convert the date and time values to the number of seconds since year 0 and since UNIX epoch of 1970.

Picture of zinsou A.A.E.Mo´se
  Performance   Level  
Name: zinsou A.A.E.Mo´se is available for providing paid consulting. Contact zinsou A.A.E.Mo´se .
Classes: 50 packages by
Country: Benin Benin
Age: 32
All time rank: 7051 in Benin Benin
Week rank: 46 Up1 in Benin Benin Equal
Innovation award
Innovation award
Nominee: 23x

Winner: 2x

IncredibleTimestamp class is powerful class to compute the time in seconds elapsed 
from year 0 to any date and time of your choice,in other words since Jesus-christ birth 
as it is the starting point for our actual calendar to your chosen datetime.

The package contains a method to convert unix timestamp to IncredibleTimestamp: UnixtoIncTimestamp($x)
$x must be a numeric

The class constructor:
public function __construct($date=false){
	$date must be a date and time formatted as	array(year,month,day,hour,min,sec) example: array(2017,12,31,00,1,59);
	if your array is not full the class will complete it itself example:	array(2017) will return always (2017,1,1,0,0,0);
	if your array has more than six elements the class will reduce it itself example:	array(2017,1,1,0,0,0,2,5,7) will return always (2017,1,1,0,0,0);
	if you don't specify a date the class will automatically return  the date and the time of the day if the day is before
	19-01-2038 04:00:00 else it will return the 01-01-0000 00:00:00

The class contains except the constructor, three methods:
-Two getters:
*public Inctimestamp() return the incredible timestamp
*public IncTimestamptoUnix() convert the incredible timestamp to unix timestamp
-and one setter
*public Timestamp () compute the incredible timestamp and assign it to the protected property timestamp.

See the testInc.php file for example of how to use.
This script is too short to provide more 
Contact at

  Files folder image Files  
File Role Description
Plain text file IncredibleTimestamp.class.php Class class source
Accessible without login Plain text file license.txt Lic. license
Accessible without login Plain text file readme.txt Doc. readme
Accessible without login Plain text file testIncr.php Example example script

 Version Control Reuses Unique User Downloads Download Rankings  
This week:0
All time:9,506
This week:174Up
For more information send a message to info at phpclasses dot org.