PHP code example of alroniks / dtms

1. Go to this page and download the library: Download alroniks/dtms library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alroniks / dtms example snippets



alroniks\dtms\DateTime;
use alroniks\dtms\DateInterval;


$dt = new DateTime('2015-08-08 10:10:10.123456');
echo $dt->format('Y-m-d H:i:s.u'); // 2015-08-08 10:10:10.123456

$dt = new DateTime('2015-08-08 10:10:10.123456');
$dt->modify('123456 micro');
echo $dt->format('u'); // 246912

$interval = new DateInterval('PT2.2S');
echo $interval->format('PT%sS'); // PT2.200000S 

$uDateTime = new DateTime(); // DateTime from package
$nativeDateTime = new \DateTime(); // built in DateTime