PHP Classes

Date from Incredible Timestamp: Compute date and time from timestamp from year 0

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 enough user ratingsTotal: 104 All time: 9,752 This week: 455Up
Version License PHP version Categories
m14 1.0Custom (specified...5PHP 5, Time and Date
Description 

Author

This class can compute date and time from timestamp from year 0.

It can take as parameter a timestamp with the number of seconds since the year 0.

The class can convert the timestamp to the date and time with years up to 99999.

Picture of zinsou A.A.E.Moïse
  Performance   Level  
Name: zinsou A.A.E.Moïse <contact>
Classes: 50 packages by
Country: Benin Benin
Innovation award
Innovation award
Nominee: 23x

Winner: 2x

Example

<?php
require_once('./DatefromInc.class.php');
$t=time();
echo
'<br>Unix timestamp :'.$t.'<br>';
$c=new IncredibleTimestamp(explode('-',date("Y-m-d-H-i-s",$t)));
echo
'<br> Incredible timestamp for actual date : '.$i=$c->IncTimestamp ();
echo
'<br> Incredible timestamp to unix for actual date : '.$c->IncTimestamptoUnix ().'<br>';

$f=new datefromIncTimestamp($i);
echo
'<br>Date and time from Incredible timestamp with christ tag for actual date :'. $f->DatefromInc().'<br>';
echo
'<br>Date and time from Incredible timestamp without christ tag actual date :'. $f->DatefromInc(false).'<br>';
echo
'<br> Date from Incredible timestamp without christ tag actual date :'. $f->GetjustDate(false).'<br>';
echo
'<br> Date from Incredible timestamp with christ tag actual date :'. $f->GetjustDate(true).'<br>';
echo
'<br>time from Incredible timestamp for actual date : '. $f->GetjustTime().'<br>';
$c=new IncredibleTimestamp(explode('-',"99999-8-31-23-22-30"));
echo
'<br>Incredible timestamp for 99999-8-31-23-22-30 : '.$j=($c->IncTimestamp ());
$f=new datefromIncTimestamp($j);
echo
'<br>Date and time from Incredible timestamp without christ tag for 99999-8-31-23-22-30 : '. $f->DatefromInc(false).'<br>';
echo
'<br> Date and time from Incredible timestamp with christ tag for 99999-8-31-23-22-30 : '. $f->DatefromInc().'<br>';

?>


Details

datefromIncTimestamp class is simple class which use an algorithm based on Incredible timestamp package to compute the exact date and time for an Incredible timestamp from year 0 to the year 99999 the 31st December at 23:59:59. The class constructor: public function __construct($x){ "The parameter must be a numeric." if $x<0 the tag 'BFJC' will be add to the result. if $x>0 the tag 'AFJC' will be add to the result. if $x==0 the tag 'First Day will be add to the result. } The class contains except the constructor, 3 methods: -DatefromInc($christtag=true) which computes and return the exact date and time for an Incredible timestamp: $christtag is used to specify if you want the tag or no. -GetjustDate($christtag=false) which computes and return the exact date an Incredible Timestamp; $christtag is used to specify if you want the tag or no. - GetjustTime() which computes and return as its name shows just the exact time an event happens for a chosen Incredible Timestamp; See the testDatefromInc.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 (4)  
File Role Description
Plain text file DatefromInc.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 testDatefromInc.php Example example script

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
Downloadm14-2017-07-30.zip 4KB
Downloadm14-2017-07-30.tar.gz
Install with ComposerInstall with Composer
Needed packages  
Class DownloadWhy it is needed Dependency
Incredible Timestamp Download .zip .tar.gz required to understand this class.This class have not sense without it Required
 Version Control Unique User Downloads Download Rankings  
 0%
Total:104
This week:0
All time:9,752
This week:455Up