PHP code example of oat-sa / lib-tao-dtms

1. Go to this page and download the library: Download oat-sa/lib-tao-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/ */

    

oat-sa / lib-tao-dtms example snippets



oat\dtms\DateTime;
use oat\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