PHP Classes
elePHPant
Icontem

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   Blog (1)    
Last Updated Ratings Unique User Downloads Download Rankings
2017-07-29 (3 months ago) RSS 2.0 feedNot enough user ratingsTotal: 69 All time: 8,955 This week: 663Up
Version License PHP version Categories
m12 1.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.

  Performance   Level  
Name: zinsou A.A.E.Mo´se is available for providing paid consulting. Contact zinsou A.A.E.Mo´se .
Classes: 21 packages by
Country: Benin Benin
Age: 28
All time rank: 18021 in Benin Benin
Week rank: 5 Up1 in Benin Benin Equal
Innovation award
Innovation award
Nominee: 5x

Details
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 
documentation.
Contact at leizmo@gmail.com

 
  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  
 0%2
Total:69
This week:0
All time:8,955
This week:663Up