skip to content

Latest News

CI:A - Certus In Audio - Latest News: read latest news from CI:A (general and special topics)

CI:A - Certus In Audio
Latest News

News

New API: Gettimeelapsed [en]

CI:A - Certus In Audio (cia) / 04 Mar 2020
CI:A
Latest News >>CI:A

Gettimeelapsed (v1.0.0-20200304)

 

Dear user,

we would like to announce that we have added the new API(s)/file(s) 'Gettimeelapsed' on this site. As you may already know, we provide on this website so-called APIs that can be freely used. These APIs have different purposes of use, e.g. 'qrcode' for creating QR codes etc. The respective purpose of use and information about the usage of the individual APIs can be found in the corresponding help texts. Some APIs also have user interfaces (or wizards) to facilitate their use.

The following list contains all files included to the API 'Gettimeelapsed':
 

gettimeelapsed (text/plain , 8600 bytes)
gettimeelapsed.htm (text/html , 44324 bytes)
gettimeelapsed.html (text/html , 44324 bytes)
gettimeelapsed.source (text/plain , 8600 bytes)
gettimeelapsed.src (text/plain , 8600 bytes)
gettimeelapsed.text (text/plain , 8600 bytes)
gettimeelapsed.txt (text/plain , 8600 bytes)

 

gettimeelapsed:
<?php /* getTimeElapsed ============== (C/W) CI:A - Certus In Audio [http://certus.in/] A very, very, ..., simple function to return elapsed time as strings. It is just a FUNCTION EXAMPLE, and maybe you will find it useful. Feel free to use it (on your own risk, for sure). HAVE FUN! :-D Sourced by CI:A - Certus In Audio [http://certus.in/]. USAGE: Please have a look at the following example code... $arrLabelSets = array( 'en' => array( 'y' => 'year' , 'm' => 'month' , 'w' => 'week' , 'd' => 'day' , 'h' => 'hour' , 'i' => 'minute' , 's' => 'second' , 'ps' => 's' , 'px' => 'just now' ) , 'de' => array( 'y' => 'Jahr(e)' , 'm' => 'Monat(e)' , 'w' => 'Woche(n)' , 'd' => 'Tag(e)' , 'h' => 'Stunde(n)' , 'i' => 'Minute(n)' , 's' => 'Sekunde(n)' , 'ps' => '' , 'px' => 'gerade jetzt' ) ); $intDemoTimesTS = rand( 0 , 2 ); $arrDemoTimes = array( 'DemoTime1' => array( 'year' => ( intval( date( 'Y' ) ) - $intDemoTimesTS ) , 'month' => ( intval( date( 'm' ) ) - $intDemoTimesTS ) , 'day' => ( intval( date( 'd' ) ) - $intDemoTimesTS ) , 'hour' => ( intval( date( 'H' ) ) - $intDemoTimesTS ) , 'minute' => ( intval( date( 'i' ) ) - $intDemoTimesTS ) , 'second' => ( intval( date( 's' ) ) - $intDemoTimesTS ) ) , 'DemoTime2' => array( 'y' => ( intval( date( 'Y' ) ) - $intDemoTimesTS ) , 'm' => ( intval( date( 'm' ) ) - $intDemoTimesTS ) , 'd' => ( intval( date( 'd' ) ) - $intDemoTimesTS ) , 'h' => ( intval( date( 'H' ) ) - $intDemoTimesTS ) , 'i' => ( intval( date( 'i' ) ) - $intDemoTimesTS ) , 's' => ( intval( date( 's' ) ) - $intDemoTimesTS ) ) , 'DemoTime3' => mktime( ( intval( date( 'H' ) ) - $intDemoTimesTS ) , ( intval( date( 'i' ) ) - $intDemoTimesTS ) , ( intval( date( 's' ) ) - $intDemoTimesTS ) , ( intval( date( 'm' ) ) - $intDemoTimesTS ) , ( intval( date( 'd' ) ) - $intDemoTimesTS ) , ( intval( date( 'Y' ) ) - $intDemoTimesTS ) ) , 'DemoTime4' => mktime( ( intval( date( 'H' ) ) - $intDemoTimesTS ) , ( intval( date( 'i' ) ) - $intDemoTimesTS ) , ( intval( date( 's' ) ) - $intDemoTimesTS ) , ( intval( date( 'm' ) ) - $intDemoTimesTS ) , ( intval( date( 'd' ) ) - $intDemoTimesTS ) , ( intval( date( 'Y' ) ) - $intDemoTimesTS ) ) , 'DemoTime5' => ( intval( date( 'Y' ) ) - $intDemoTimesTS ) . '-' . ( intval( date( 'm' ) ) - $intDemoTimesTS ) . '-' . ( intval( date( 'd' ) ) - $intDemoTimesTS ) . ' ' . ( intval( date( 'H' ) ) - $intDemoTimesTS ) . ':' . ( intval( date( 'i' ) ) - $intDemoTimesTS ) . ':' . ( intval( date( 's' ) ) - $intDemoTimesTS ) , 'DemoTime6' => ( intval( date( 'Y' ) ) - $intDemoTimesTS ) . '-' . ( intval( date( 'm' ) ) - $intDemoTimesTS ) . '-' . ( intval( date( 'd' ) ) - $intDemoTimesTS ) . ' ' . ( intval( date( 'H' ) ) - $intDemoTimesTS ) . ':' . ( intval( date( 'i' ) ) - $intDemoTimesTS ) . ':' . ( intval( date( 's' ) ) - $intDemoTimesTS ) ); header( 'Content-Type: text/plain' ); foreach( $arrLabelSets as $strLSK => $arrLSV ) { echo strtoupper( $strLSK ) . PHP_EOL; foreach( $arrDemoTimes as $strDTK => $mxDTV ) { echo $strDTK . ' > ' . getTimeElapsed( $mxDTV , false , $arrLSV ) . PHP_EOL . ' ' . str_replace( array( PHP_EOL , ' ' , 'Array' ) , array( '' , ' ' , '' ) , print_r( getTimeElapsed( $mxDTV , true ) , true ) ) . PHP_EOL . PHP_EOL; } echo PHP_EOL; } */ function getTimeElapsed( $mxDateTime , $bReturnAsArray = null , $arrLabelSet = null ) { if( is_array( $mxDateTime ) ) { $mxDateTime = array_change_key_case( $mxDateTime , CASE_LOWER ); $mxDateTime = ( ( isset( $mxDateTime[ 'year' ] ) ) ? $mxDateTime[ 'year' ] : ( ( isset( $mxDateTime[ 'y' ] ) ) ? $mxDateTime[ 'y' ] : date( 'Y' ) ) ) . '-' . ( ( isset( $mxDateTime[ 'month' ] ) ) ? $mxDateTime[ 'month' ] : ( ( isset( $mxDateTime[ 'm' ] ) ) ? $mxDateTime[ 'm' ] : date( 'm' ) ) ) . '-' . ( ( isset( $mxDateTime[ 'day' ] ) ) ? $mxDateTime[ 'day' ] : ( ( isset( $mxDateTime[ 'd' ] ) ) ? $mxDateTime[ 'd' ] : date( 'd' ) ) ) . ' ' . ( ( isset( $mxDateTime[ 'hour' ] ) ) ? $mxDateTime[ 'hour' ] : ( ( isset( $mxDateTime[ 'h' ] ) ) ? $mxDateTime[ 'h' ] : date( 'H' ) ) ) . ':' . ( ( isset( $mxDateTime[ 'minute' ] ) ) ? $mxDateTime[ 'minute' ] : ( ( isset( $mxDateTime[ 'i' ] ) ) ? $mxDateTime[ 'i' ] : date( 'i' ) ) ) . ':' . ( ( isset( $mxDateTime[ 'second' ] ) ) ? $mxDateTime[ 'second' ] : ( ( isset( $mxDateTime[ 's' ] ) ) ? $mxDateTime[ 's' ] : date( 's' ) ) ); } elseif( is_integer( $mxDateTime ) ) { $mxDateTime = date( 'Y-m-d H:i:s' , $mxDateTime ); } else { if( ! is_string( $mxDateTime ) ) { $mxDateTime = date( 'Y-m-d H:i:s' ); } } $objCurrentTime = new DateTime(); $objTimeDifference = $objCurrentTime->diff( new DateTime( $mxDateTime ) ); $objTimeDifference->w = floor( $objTimeDifference->d / 7 ); $objTimeDifference->d -= $objTimeDifference->w * 7; if( ( is_bool( $bReturnAsArray ) ) && ( $bReturnAsArray ) ) { return array( 'year' => $objTimeDifference->y , 'y' => $objTimeDifference->y , 'month' => $objTimeDifference->m , 'm' => $objTimeDifference->m , 'week' => $objTimeDifference->w , 'w' => $objTimeDifference->w , 'day' => $objTimeDifference->d , 'd' => $objTimeDifference->d , 'hour' => $objTimeDifference->h , 'h' => $objTimeDifference->h , 'minute' => $objTimeDifference->i , 'i' => $objTimeDifference->i , 'second' => $objTimeDifference->s , 's' => $objTimeDifference->s ); } if( ! is_array( $arrLabelSet ) ) { $arrLabelSet = array( 'y' => 'year' , 'm' => 'month' , 'w' => 'week' , 'd' => 'day' , 'h' => 'hour' , 'i' => 'minute' , 's' => 'second' , 'ps' => 's' , 'px' => 'just now' ); } foreach( $arrLabelSet as $strKey => &$mxValue ) { if( strlen( $strKey ) > 1 ) { continue; } if( $objTimeDifference->$strKey ) { $mxValue = $objTimeDifference->$strKey . ' ' . $mxValue . ( $objTimeDifference->$strKey > 1 ? $arrLabelSet[ 'ps' ] : '' ); } else { $arrLabelSet[ $strKey ] = null; unset( $arrLabelSet[ $strKey ] ); } } $strPXTmp = $arrLabelSet[ 'px' ]; $arrLabelSet[ 'px' ] = null; unset( $arrLabelSet[ 'px' ] ); $arrLabelSet[ 'ps' ] = null; unset( $arrLabelSet[ 'ps' ] ); return ( $arrLabelSet ) ? implode( ', ' , $arrLabelSet ) : $strPXTmp; } ?>


 

gettimeelapsed.source:
<?php /* getTimeElapsed ============== (C/W) CI:A - Certus In Audio [http://certus.in/] A very, very, ..., simple function to return elapsed time as strings. It is just a FUNCTION EXAMPLE, and maybe you will find it useful. Feel free to use it (on your own risk, for sure). HAVE FUN! :-D Sourced by CI:A - Certus In Audio [http://certus.in/]. USAGE: Please have a look at the following example code... $arrLabelSets = array( 'en' => array( 'y' => 'year' , 'm' => 'month' , 'w' => 'week' , 'd' => 'day' , 'h' => 'hour' , 'i' => 'minute' , 's' => 'second' , 'ps' => 's' , 'px' => 'just now' ) , 'de' => array( 'y' => 'Jahr(e)' , 'm' => 'Monat(e)' , 'w' => 'Woche(n)' , 'd' => 'Tag(e)' , 'h' => 'Stunde(n)' , 'i' => 'Minute(n)' , 's' => 'Sekunde(n)' , 'ps' => '' , 'px' => 'gerade jetzt' ) ); $intDemoTimesTS = rand( 0 , 2 ); $arrDemoTimes = array( 'DemoTime1' => array( 'year' => ( intval( date( 'Y' ) ) - $intDemoTimesTS ) , 'month' => ( intval( date( 'm' ) ) - $intDemoTimesTS ) , 'day' => ( intval( date( 'd' ) ) - $intDemoTimesTS ) , 'hour' => ( intval( date( 'H' ) ) - $intDemoTimesTS ) , 'minute' => ( intval( date( 'i' ) ) - $intDemoTimesTS ) , 'second' => ( intval( date( 's' ) ) - $intDemoTimesTS ) ) , 'DemoTime2' => array( 'y' => ( intval( date( 'Y' ) ) - $intDemoTimesTS ) , 'm' => ( intval( date( 'm' ) ) - $intDemoTimesTS ) , 'd' => ( intval( date( 'd' ) ) - $intDemoTimesTS ) , 'h' => ( intval( date( 'H' ) ) - $intDemoTimesTS ) , 'i' => ( intval( date( 'i' ) ) - $intDemoTimesTS ) , 's' => ( intval( date( 's' ) ) - $intDemoTimesTS ) ) , 'DemoTime3' => mktime( ( intval( date( 'H' ) ) - $intDemoTimesTS ) , ( intval( date( 'i' ) ) - $intDemoTimesTS ) , ( intval( date( 's' ) ) - $intDemoTimesTS ) , ( intval( date( 'm' ) ) - $intDemoTimesTS ) , ( intval( date( 'd' ) ) - $intDemoTimesTS ) , ( intval( date( 'Y' ) ) - $intDemoTimesTS ) ) , 'DemoTime4' => mktime( ( intval( date( 'H' ) ) - $intDemoTimesTS ) , ( intval( date( 'i' ) ) - $intDemoTimesTS ) , ( intval( date( 's' ) ) - $intDemoTimesTS ) , ( intval( date( 'm' ) ) - $intDemoTimesTS ) , ( intval( date( 'd' ) ) - $intDemoTimesTS ) , ( intval( date( 'Y' ) ) - $intDemoTimesTS ) ) , 'DemoTime5' => ( intval( date( 'Y' ) ) - $intDemoTimesTS ) . '-' . ( intval( date( 'm' ) ) - $intDemoTimesTS ) . '-' . ( intval( date( 'd' ) ) - $intDemoTimesTS ) . ' ' . ( intval( date( 'H' ) ) - $intDemoTimesTS ) . ':' . ( intval( date( 'i' ) ) - $intDemoTimesTS ) . ':' . ( intval( date( 's' ) ) - $intDemoTimesTS ) , 'DemoTime6' => ( intval( date( 'Y' ) ) - $intDemoTimesTS ) . '-' . ( intval( date( 'm' ) ) - $intDemoTimesTS ) . '-' . ( intval( date( 'd' ) ) - $intDemoTimesTS ) . ' ' . ( intval( date( 'H' ) ) - $intDemoTimesTS ) . ':' . ( intval( date( 'i' ) ) - $intDemoTimesTS ) . ':' . ( intval( date( 's' ) ) - $intDemoTimesTS ) ); header( 'Content-Type: text/plain' ); foreach( $arrLabelSets as $strLSK => $arrLSV ) { echo strtoupper( $strLSK ) . PHP_EOL; foreach( $arrDemoTimes as $strDTK => $mxDTV ) { echo $strDTK . ' > ' . getTimeElapsed( $mxDTV , false , $arrLSV ) . PHP_EOL . ' ' . str_replace( array( PHP_EOL , ' ' , 'Array' ) , array( '' , ' ' , '' ) , print_r( getTimeElapsed( $mxDTV , true ) , true ) ) . PHP_EOL . PHP_EOL; } echo PHP_EOL; } */ function getTimeElapsed( $mxDateTime , $bReturnAsArray = null , $arrLabelSet = null ) { if( is_array( $mxDateTime ) ) { $mxDateTime = array_change_key_case( $mxDateTime , CASE_LOWER ); $mxDateTime = ( ( isset( $mxDateTime[ 'year' ] ) ) ? $mxDateTime[ 'year' ] : ( ( isset( $mxDateTime[ 'y' ] ) ) ? $mxDateTime[ 'y' ] : date( 'Y' ) ) ) . '-' . ( ( isset( $mxDateTime[ 'month' ] ) ) ? $mxDateTime[ 'month' ] : ( ( isset( $mxDateTime[ 'm' ] ) ) ? $mxDateTime[ 'm' ] : date( 'm' ) ) ) . '-' . ( ( isset( $mxDateTime[ 'day' ] ) ) ? $mxDateTime[ 'day' ] : ( ( isset( $mxDateTime[ 'd' ] ) ) ? $mxDateTime[ 'd' ] : date( 'd' ) ) ) . ' ' . ( ( isset( $mxDateTime[ 'hour' ] ) ) ? $mxDateTime[ 'hour' ] : ( ( isset( $mxDateTime[ 'h' ] ) ) ? $mxDateTime[ 'h' ] : date( 'H' ) ) ) . ':' . ( ( isset( $mxDateTime[ 'minute' ] ) ) ? $mxDateTime[ 'minute' ] : ( ( isset( $mxDateTime[ 'i' ] ) ) ? $mxDateTime[ 'i' ] : date( 'i' ) ) ) . ':' . ( ( isset( $mxDateTime[ 'second' ] ) ) ? $mxDateTime[ 'second' ] : ( ( isset( $mxDateTime[ 's' ] ) ) ? $mxDateTime[ 's' ] : date( 's' ) ) ); } elseif( is_integer( $mxDateTime ) ) { $mxDateTime = date( 'Y-m-d H:i:s' , $mxDateTime ); } else { if( ! is_string( $mxDateTime ) ) { $mxDateTime = date( 'Y-m-d H:i:s' ); } } $objCurrentTime = new DateTime(); $objTimeDifference = $objCurrentTime->diff( new DateTime( $mxDateTime ) ); $objTimeDifference->w = floor( $objTimeDifference->d / 7 ); $objTimeDifference->d -= $objTimeDifference->w * 7; if( ( is_bool( $bReturnAsArray ) ) && ( $bReturnAsArray ) ) { return array( 'year' => $objTimeDifference->y , 'y' => $objTimeDifference->y , 'month' => $objTimeDifference->m , 'm' => $objTimeDifference->m , 'week' => $objTimeDifference->w , 'w' => $objTimeDifference->w , 'day' => $objTimeDifference->d , 'd' => $objTimeDifference->d , 'hour' => $objTimeDifference->h , 'h' => $objTimeDifference->h , 'minute' => $objTimeDifference->i , 'i' => $objTimeDifference->i , 'second' => $objTimeDifference->s , 's' => $objTimeDifference->s ); } if( ! is_array( $arrLabelSet ) ) { $arrLabelSet = array( 'y' => 'year' , 'm' => 'month' , 'w' => 'week' , 'd' => 'day' , 'h' => 'hour' , 'i' => 'minute' , 's' => 'second' , 'ps' => 's' , 'px' => 'just now' ); } foreach( $arrLabelSet as $strKey => &$mxValue ) { if( strlen( $strKey ) > 1 ) { continue; } if( $objTimeDifference->$strKey ) { $mxValue = $objTimeDifference->$strKey . ' ' . $mxValue . ( $objTimeDifference->$strKey > 1 ? $arrLabelSet[ 'ps' ] : '' ); } else { $arrLabelSet[ $strKey ] = null; unset( $arrLabelSet[ $strKey ] ); } } $strPXTmp = $arrLabelSet[ 'px' ]; $arrLabelSet[ 'px' ] = null; unset( $arrLabelSet[ 'px' ] ); $arrLabelSet[ 'ps' ] = null; unset( $arrLabelSet[ 'ps' ] ); return ( $arrLabelSet ) ? implode( ', ' , $arrLabelSet ) : $strPXTmp; } ?>


 

gettimeelapsed.src:
<?php /* getTimeElapsed ============== (C/W) CI:A - Certus In Audio [http://certus.in/] A very, very, ..., simple function to return elapsed time as strings. It is just a FUNCTION EXAMPLE, and maybe you will find it useful. Feel free to use it (on your own risk, for sure). HAVE FUN! :-D Sourced by CI:A - Certus In Audio [http://certus.in/]. USAGE: Please have a look at the following example code... $arrLabelSets = array( 'en' => array( 'y' => 'year' , 'm' => 'month' , 'w' => 'week' , 'd' => 'day' , 'h' => 'hour' , 'i' => 'minute' , 's' => 'second' , 'ps' => 's' , 'px' => 'just now' ) , 'de' => array( 'y' => 'Jahr(e)' , 'm' => 'Monat(e)' , 'w' => 'Woche(n)' , 'd' => 'Tag(e)' , 'h' => 'Stunde(n)' , 'i' => 'Minute(n)' , 's' => 'Sekunde(n)' , 'ps' => '' , 'px' => 'gerade jetzt' ) ); $intDemoTimesTS = rand( 0 , 2 ); $arrDemoTimes = array( 'DemoTime1' => array( 'year' => ( intval( date( 'Y' ) ) - $intDemoTimesTS ) , 'month' => ( intval( date( 'm' ) ) - $intDemoTimesTS ) , 'day' => ( intval( date( 'd' ) ) - $intDemoTimesTS ) , 'hour' => ( intval( date( 'H' ) ) - $intDemoTimesTS ) , 'minute' => ( intval( date( 'i' ) ) - $intDemoTimesTS ) , 'second' => ( intval( date( 's' ) ) - $intDemoTimesTS ) ) , 'DemoTime2' => array( 'y' => ( intval( date( 'Y' ) ) - $intDemoTimesTS ) , 'm' => ( intval( date( 'm' ) ) - $intDemoTimesTS ) , 'd' => ( intval( date( 'd' ) ) - $intDemoTimesTS ) , 'h' => ( intval( date( 'H' ) ) - $intDemoTimesTS ) , 'i' => ( intval( date( 'i' ) ) - $intDemoTimesTS ) , 's' => ( intval( date( 's' ) ) - $intDemoTimesTS ) ) , 'DemoTime3' => mktime( ( intval( date( 'H' ) ) - $intDemoTimesTS ) , ( intval( date( 'i' ) ) - $intDemoTimesTS ) , ( intval( date( 's' ) ) - $intDemoTimesTS ) , ( intval( date( 'm' ) ) - $intDemoTimesTS ) , ( intval( date( 'd' ) ) - $intDemoTimesTS ) , ( intval( date( 'Y' ) ) - $intDemoTimesTS ) ) , 'DemoTime4' => mktime( ( intval( date( 'H' ) ) - $intDemoTimesTS ) , ( intval( date( 'i' ) ) - $intDemoTimesTS ) , ( intval( date( 's' ) ) - $intDemoTimesTS ) , ( intval( date( 'm' ) ) - $intDemoTimesTS ) , ( intval( date( 'd' ) ) - $intDemoTimesTS ) , ( intval( date( 'Y' ) ) - $intDemoTimesTS ) ) , 'DemoTime5' => ( intval( date( 'Y' ) ) - $intDemoTimesTS ) . '-' . ( intval( date( 'm' ) ) - $intDemoTimesTS ) . '-' . ( intval( date( 'd' ) ) - $intDemoTimesTS ) . ' ' . ( intval( date( 'H' ) ) - $intDemoTimesTS ) . ':' . ( intval( date( 'i' ) ) - $intDemoTimesTS ) . ':' . ( intval( date( 's' ) ) - $intDemoTimesTS ) , 'DemoTime6' => ( intval( date( 'Y' ) ) - $intDemoTimesTS ) . '-' . ( intval( date( 'm' ) ) - $intDemoTimesTS ) . '-' . ( intval( date( 'd' ) ) - $intDemoTimesTS ) . ' ' . ( intval( date( 'H' ) ) - $intDemoTimesTS ) . ':' . ( intval( date( 'i' ) ) - $intDemoTimesTS ) . ':' . ( intval( date( 's' ) ) - $intDemoTimesTS ) ); header( 'Content-Type: text/plain' ); foreach( $arrLabelSets as $strLSK => $arrLSV ) { echo strtoupper( $strLSK ) . PHP_EOL; foreach( $arrDemoTimes as $strDTK => $mxDTV ) { echo $strDTK . ' > ' . getTimeElapsed( $mxDTV , false , $arrLSV ) . PHP_EOL . ' ' . str_replace( array( PHP_EOL , ' ' , 'Array' ) , array( '' , ' ' , '' ) , print_r( getTimeElapsed( $mxDTV , true ) , true ) ) . PHP_EOL . PHP_EOL; } echo PHP_EOL; } */ function getTimeElapsed( $mxDateTime , $bReturnAsArray = null , $arrLabelSet = null ) { if( is_array( $mxDateTime ) ) { $mxDateTime = array_change_key_case( $mxDateTime , CASE_LOWER ); $mxDateTime = ( ( isset( $mxDateTime[ 'year' ] ) ) ? $mxDateTime[ 'year' ] : ( ( isset( $mxDateTime[ 'y' ] ) ) ? $mxDateTime[ 'y' ] : date( 'Y' ) ) ) . '-' . ( ( isset( $mxDateTime[ 'month' ] ) ) ? $mxDateTime[ 'month' ] : ( ( isset( $mxDateTime[ 'm' ] ) ) ? $mxDateTime[ 'm' ] : date( 'm' ) ) ) . '-' . ( ( isset( $mxDateTime[ 'day' ] ) ) ? $mxDateTime[ 'day' ] : ( ( isset( $mxDateTime[ 'd' ] ) ) ? $mxDateTime[ 'd' ] : date( 'd' ) ) ) . ' ' . ( ( isset( $mxDateTime[ 'hour' ] ) ) ? $mxDateTime[ 'hour' ] : ( ( isset( $mxDateTime[ 'h' ] ) ) ? $mxDateTime[ 'h' ] : date( 'H' ) ) ) . ':' . ( ( isset( $mxDateTime[ 'minute' ] ) ) ? $mxDateTime[ 'minute' ] : ( ( isset( $mxDateTime[ 'i' ] ) ) ? $mxDateTime[ 'i' ] : date( 'i' ) ) ) . ':' . ( ( isset( $mxDateTime[ 'second' ] ) ) ? $mxDateTime[ 'second' ] : ( ( isset( $mxDateTime[ 's' ] ) ) ? $mxDateTime[ 's' ] : date( 's' ) ) ); } elseif( is_integer( $mxDateTime ) ) { $mxDateTime = date( 'Y-m-d H:i:s' , $mxDateTime ); } else { if( ! is_string( $mxDateTime ) ) { $mxDateTime = date( 'Y-m-d H:i:s' ); } } $objCurrentTime = new DateTime(); $objTimeDifference = $objCurrentTime->diff( new DateTime( $mxDateTime ) ); $objTimeDifference->w = floor( $objTimeDifference->d / 7 ); $objTimeDifference->d -= $objTimeDifference->w * 7; if( ( is_bool( $bReturnAsArray ) ) && ( $bReturnAsArray ) ) { return array( 'year' => $objTimeDifference->y , 'y' => $objTimeDifference->y , 'month' => $objTimeDifference->m , 'm' => $objTimeDifference->m , 'week' => $objTimeDifference->w , 'w' => $objTimeDifference->w , 'day' => $objTimeDifference->d , 'd' => $objTimeDifference->d , 'hour' => $objTimeDifference->h , 'h' => $objTimeDifference->h , 'minute' => $objTimeDifference->i , 'i' => $objTimeDifference->i , 'second' => $objTimeDifference->s , 's' => $objTimeDifference->s ); } if( ! is_array( $arrLabelSet ) ) { $arrLabelSet = array( 'y' => 'year' , 'm' => 'month' , 'w' => 'week' , 'd' => 'day' , 'h' => 'hour' , 'i' => 'minute' , 's' => 'second' , 'ps' => 's' , 'px' => 'just now' ); } foreach( $arrLabelSet as $strKey => &$mxValue ) { if( strlen( $strKey ) > 1 ) { continue; } if( $objTimeDifference->$strKey ) { $mxValue = $objTimeDifference->$strKey . ' ' . $mxValue . ( $objTimeDifference->$strKey > 1 ? $arrLabelSet[ 'ps' ] : '' ); } else { $arrLabelSet[ $strKey ] = null; unset( $arrLabelSet[ $strKey ] ); } } $strPXTmp = $arrLabelSet[ 'px' ]; $arrLabelSet[ 'px' ] = null; unset( $arrLabelSet[ 'px' ] ); $arrLabelSet[ 'ps' ] = null; unset( $arrLabelSet[ 'ps' ] ); return ( $arrLabelSet ) ? implode( ', ' , $arrLabelSet ) : $strPXTmp; } ?>


 

gettimeelapsed.text:
<?php /* getTimeElapsed ============== (C/W) CI:A - Certus In Audio [http://certus.in/] A very, very, ..., simple function to return elapsed time as strings. It is just a FUNCTION EXAMPLE, and maybe you will find it useful. Feel free to use it (on your own risk, for sure). HAVE FUN! :-D Sourced by CI:A - Certus In Audio [http://certus.in/]. USAGE: Please have a look at the following example code... $arrLabelSets = array( 'en' => array( 'y' => 'year' , 'm' => 'month' , 'w' => 'week' , 'd' => 'day' , 'h' => 'hour' , 'i' => 'minute' , 's' => 'second' , 'ps' => 's' , 'px' => 'just now' ) , 'de' => array( 'y' => 'Jahr(e)' , 'm' => 'Monat(e)' , 'w' => 'Woche(n)' , 'd' => 'Tag(e)' , 'h' => 'Stunde(n)' , 'i' => 'Minute(n)' , 's' => 'Sekunde(n)' , 'ps' => '' , 'px' => 'gerade jetzt' ) ); $intDemoTimesTS = rand( 0 , 2 ); $arrDemoTimes = array( 'DemoTime1' => array( 'year' => ( intval( date( 'Y' ) ) - $intDemoTimesTS ) , 'month' => ( intval( date( 'm' ) ) - $intDemoTimesTS ) , 'day' => ( intval( date( 'd' ) ) - $intDemoTimesTS ) , 'hour' => ( intval( date( 'H' ) ) - $intDemoTimesTS ) , 'minute' => ( intval( date( 'i' ) ) - $intDemoTimesTS ) , 'second' => ( intval( date( 's' ) ) - $intDemoTimesTS ) ) , 'DemoTime2' => array( 'y' => ( intval( date( 'Y' ) ) - $intDemoTimesTS ) , 'm' => ( intval( date( 'm' ) ) - $intDemoTimesTS ) , 'd' => ( intval( date( 'd' ) ) - $intDemoTimesTS ) , 'h' => ( intval( date( 'H' ) ) - $intDemoTimesTS ) , 'i' => ( intval( date( 'i' ) ) - $intDemoTimesTS ) , 's' => ( intval( date( 's' ) ) - $intDemoTimesTS ) ) , 'DemoTime3' => mktime( ( intval( date( 'H' ) ) - $intDemoTimesTS ) , ( intval( date( 'i' ) ) - $intDemoTimesTS ) , ( intval( date( 's' ) ) - $intDemoTimesTS ) , ( intval( date( 'm' ) ) - $intDemoTimesTS ) , ( intval( date( 'd' ) ) - $intDemoTimesTS ) , ( intval( date( 'Y' ) ) - $intDemoTimesTS ) ) , 'DemoTime4' => mktime( ( intval( date( 'H' ) ) - $intDemoTimesTS ) , ( intval( date( 'i' ) ) - $intDemoTimesTS ) , ( intval( date( 's' ) ) - $intDemoTimesTS ) , ( intval( date( 'm' ) ) - $intDemoTimesTS ) , ( intval( date( 'd' ) ) - $intDemoTimesTS ) , ( intval( date( 'Y' ) ) - $intDemoTimesTS ) ) , 'DemoTime5' => ( intval( date( 'Y' ) ) - $intDemoTimesTS ) . '-' . ( intval( date( 'm' ) ) - $intDemoTimesTS ) . '-' . ( intval( date( 'd' ) ) - $intDemoTimesTS ) . ' ' . ( intval( date( 'H' ) ) - $intDemoTimesTS ) . ':' . ( intval( date( 'i' ) ) - $intDemoTimesTS ) . ':' . ( intval( date( 's' ) ) - $intDemoTimesTS ) , 'DemoTime6' => ( intval( date( 'Y' ) ) - $intDemoTimesTS ) . '-' . ( intval( date( 'm' ) ) - $intDemoTimesTS ) . '-' . ( intval( date( 'd' ) ) - $intDemoTimesTS ) . ' ' . ( intval( date( 'H' ) ) - $intDemoTimesTS ) . ':' . ( intval( date( 'i' ) ) - $intDemoTimesTS ) . ':' . ( intval( date( 's' ) ) - $intDemoTimesTS ) ); header( 'Content-Type: text/plain' ); foreach( $arrLabelSets as $strLSK => $arrLSV ) { echo strtoupper( $strLSK ) . PHP_EOL; foreach( $arrDemoTimes as $strDTK => $mxDTV ) { echo $strDTK . ' > ' . getTimeElapsed( $mxDTV , false , $arrLSV ) . PHP_EOL . ' ' . str_replace( array( PHP_EOL , ' ' , 'Array' ) , array( '' , ' ' , '' ) , print_r( getTimeElapsed( $mxDTV , true ) , true ) ) . PHP_EOL . PHP_EOL; } echo PHP_EOL; } */ function getTimeElapsed( $mxDateTime , $bReturnAsArray = null , $arrLabelSet = null ) { if( is_array( $mxDateTime ) ) { $mxDateTime = array_change_key_case( $mxDateTime , CASE_LOWER ); $mxDateTime = ( ( isset( $mxDateTime[ 'year' ] ) ) ? $mxDateTime[ 'year' ] : ( ( isset( $mxDateTime[ 'y' ] ) ) ? $mxDateTime[ 'y' ] : date( 'Y' ) ) ) . '-' . ( ( isset( $mxDateTime[ 'month' ] ) ) ? $mxDateTime[ 'month' ] : ( ( isset( $mxDateTime[ 'm' ] ) ) ? $mxDateTime[ 'm' ] : date( 'm' ) ) ) . '-' . ( ( isset( $mxDateTime[ 'day' ] ) ) ? $mxDateTime[ 'day' ] : ( ( isset( $mxDateTime[ 'd' ] ) ) ? $mxDateTime[ 'd' ] : date( 'd' ) ) ) . ' ' . ( ( isset( $mxDateTime[ 'hour' ] ) ) ? $mxDateTime[ 'hour' ] : ( ( isset( $mxDateTime[ 'h' ] ) ) ? $mxDateTime[ 'h' ] : date( 'H' ) ) ) . ':' . ( ( isset( $mxDateTime[ 'minute' ] ) ) ? $mxDateTime[ 'minute' ] : ( ( isset( $mxDateTime[ 'i' ] ) ) ? $mxDateTime[ 'i' ] : date( 'i' ) ) ) . ':' . ( ( isset( $mxDateTime[ 'second' ] ) ) ? $mxDateTime[ 'second' ] : ( ( isset( $mxDateTime[ 's' ] ) ) ? $mxDateTime[ 's' ] : date( 's' ) ) ); } elseif( is_integer( $mxDateTime ) ) { $mxDateTime = date( 'Y-m-d H:i:s' , $mxDateTime ); } else { if( ! is_string( $mxDateTime ) ) { $mxDateTime = date( 'Y-m-d H:i:s' ); } } $objCurrentTime = new DateTime(); $objTimeDifference = $objCurrentTime->diff( new DateTime( $mxDateTime ) ); $objTimeDifference->w = floor( $objTimeDifference->d / 7 ); $objTimeDifference->d -= $objTimeDifference->w * 7; if( ( is_bool( $bReturnAsArray ) ) && ( $bReturnAsArray ) ) { return array( 'year' => $objTimeDifference->y , 'y' => $objTimeDifference->y , 'month' => $objTimeDifference->m , 'm' => $objTimeDifference->m , 'week' => $objTimeDifference->w , 'w' => $objTimeDifference->w , 'day' => $objTimeDifference->d , 'd' => $objTimeDifference->d , 'hour' => $objTimeDifference->h , 'h' => $objTimeDifference->h , 'minute' => $objTimeDifference->i , 'i' => $objTimeDifference->i , 'second' => $objTimeDifference->s , 's' => $objTimeDifference->s ); } if( ! is_array( $arrLabelSet ) ) { $arrLabelSet = array( 'y' => 'year' , 'm' => 'month' , 'w' => 'week' , 'd' => 'day' , 'h' => 'hour' , 'i' => 'minute' , 's' => 'second' , 'ps' => 's' , 'px' => 'just now' ); } foreach( $arrLabelSet as $strKey => &$mxValue ) { if( strlen( $strKey ) > 1 ) { continue; } if( $objTimeDifference->$strKey ) { $mxValue = $objTimeDifference->$strKey . ' ' . $mxValue . ( $objTimeDifference->$strKey > 1 ? $arrLabelSet[ 'ps' ] : '' ); } else { $arrLabelSet[ $strKey ] = null; unset( $arrLabelSet[ $strKey ] ); } } $strPXTmp = $arrLabelSet[ 'px' ]; $arrLabelSet[ 'px' ] = null; unset( $arrLabelSet[ 'px' ] ); $arrLabelSet[ 'ps' ] = null; unset( $arrLabelSet[ 'ps' ] ); return ( $arrLabelSet ) ? implode( ', ' , $arrLabelSet ) : $strPXTmp; } ?>


 

gettimeelapsed.txt:
<?php /* getTimeElapsed ============== (C/W) CI:A - Certus In Audio [http://certus.in/] A very, very, ..., simple function to return elapsed time as strings. It is just a FUNCTION EXAMPLE, and maybe you will find it useful. Feel free to use it (on your own risk, for sure). HAVE FUN! :-D Sourced by CI:A - Certus In Audio [http://certus.in/]. USAGE: Please have a look at the following example code... $arrLabelSets = array( 'en' => array( 'y' => 'year' , 'm' => 'month' , 'w' => 'week' , 'd' => 'day' , 'h' => 'hour' , 'i' => 'minute' , 's' => 'second' , 'ps' => 's' , 'px' => 'just now' ) , 'de' => array( 'y' => 'Jahr(e)' , 'm' => 'Monat(e)' , 'w' => 'Woche(n)' , 'd' => 'Tag(e)' , 'h' => 'Stunde(n)' , 'i' => 'Minute(n)' , 's' => 'Sekunde(n)' , 'ps' => '' , 'px' => 'gerade jetzt' ) ); $intDemoTimesTS = rand( 0 , 2 ); $arrDemoTimes = array( 'DemoTime1' => array( 'year' => ( intval( date( 'Y' ) ) - $intDemoTimesTS ) , 'month' => ( intval( date( 'm' ) ) - $intDemoTimesTS ) , 'day' => ( intval( date( 'd' ) ) - $intDemoTimesTS ) , 'hour' => ( intval( date( 'H' ) ) - $intDemoTimesTS ) , 'minute' => ( intval( date( 'i' ) ) - $intDemoTimesTS ) , 'second' => ( intval( date( 's' ) ) - $intDemoTimesTS ) ) , 'DemoTime2' => array( 'y' => ( intval( date( 'Y' ) ) - $intDemoTimesTS ) , 'm' => ( intval( date( 'm' ) ) - $intDemoTimesTS ) , 'd' => ( intval( date( 'd' ) ) - $intDemoTimesTS ) , 'h' => ( intval( date( 'H' ) ) - $intDemoTimesTS ) , 'i' => ( intval( date( 'i' ) ) - $intDemoTimesTS ) , 's' => ( intval( date( 's' ) ) - $intDemoTimesTS ) ) , 'DemoTime3' => mktime( ( intval( date( 'H' ) ) - $intDemoTimesTS ) , ( intval( date( 'i' ) ) - $intDemoTimesTS ) , ( intval( date( 's' ) ) - $intDemoTimesTS ) , ( intval( date( 'm' ) ) - $intDemoTimesTS ) , ( intval( date( 'd' ) ) - $intDemoTimesTS ) , ( intval( date( 'Y' ) ) - $intDemoTimesTS ) ) , 'DemoTime4' => mktime( ( intval( date( 'H' ) ) - $intDemoTimesTS ) , ( intval( date( 'i' ) ) - $intDemoTimesTS ) , ( intval( date( 's' ) ) - $intDemoTimesTS ) , ( intval( date( 'm' ) ) - $intDemoTimesTS ) , ( intval( date( 'd' ) ) - $intDemoTimesTS ) , ( intval( date( 'Y' ) ) - $intDemoTimesTS ) ) , 'DemoTime5' => ( intval( date( 'Y' ) ) - $intDemoTimesTS ) . '-' . ( intval( date( 'm' ) ) - $intDemoTimesTS ) . '-' . ( intval( date( 'd' ) ) - $intDemoTimesTS ) . ' ' . ( intval( date( 'H' ) ) - $intDemoTimesTS ) . ':' . ( intval( date( 'i' ) ) - $intDemoTimesTS ) . ':' . ( intval( date( 's' ) ) - $intDemoTimesTS ) , 'DemoTime6' => ( intval( date( 'Y' ) ) - $intDemoTimesTS ) . '-' . ( intval( date( 'm' ) ) - $intDemoTimesTS ) . '-' . ( intval( date( 'd' ) ) - $intDemoTimesTS ) . ' ' . ( intval( date( 'H' ) ) - $intDemoTimesTS ) . ':' . ( intval( date( 'i' ) ) - $intDemoTimesTS ) . ':' . ( intval( date( 's' ) ) - $intDemoTimesTS ) ); header( 'Content-Type: text/plain' ); foreach( $arrLabelSets as $strLSK => $arrLSV ) { echo strtoupper( $strLSK ) . PHP_EOL; foreach( $arrDemoTimes as $strDTK => $mxDTV ) { echo $strDTK . ' > ' . getTimeElapsed( $mxDTV , false , $arrLSV ) . PHP_EOL . ' ' . str_replace( array( PHP_EOL , ' ' , 'Array' ) , array( '' , ' ' , '' ) , print_r( getTimeElapsed( $mxDTV , true ) , true ) ) . PHP_EOL . PHP_EOL; } echo PHP_EOL; } */ function getTimeElapsed( $mxDateTime , $bReturnAsArray = null , $arrLabelSet = null ) { if( is_array( $mxDateTime ) ) { $mxDateTime = array_change_key_case( $mxDateTime , CASE_LOWER ); $mxDateTime = ( ( isset( $mxDateTime[ 'year' ] ) ) ? $mxDateTime[ 'year' ] : ( ( isset( $mxDateTime[ 'y' ] ) ) ? $mxDateTime[ 'y' ] : date( 'Y' ) ) ) . '-' . ( ( isset( $mxDateTime[ 'month' ] ) ) ? $mxDateTime[ 'month' ] : ( ( isset( $mxDateTime[ 'm' ] ) ) ? $mxDateTime[ 'm' ] : date( 'm' ) ) ) . '-' . ( ( isset( $mxDateTime[ 'day' ] ) ) ? $mxDateTime[ 'day' ] : ( ( isset( $mxDateTime[ 'd' ] ) ) ? $mxDateTime[ 'd' ] : date( 'd' ) ) ) . ' ' . ( ( isset( $mxDateTime[ 'hour' ] ) ) ? $mxDateTime[ 'hour' ] : ( ( isset( $mxDateTime[ 'h' ] ) ) ? $mxDateTime[ 'h' ] : date( 'H' ) ) ) . ':' . ( ( isset( $mxDateTime[ 'minute' ] ) ) ? $mxDateTime[ 'minute' ] : ( ( isset( $mxDateTime[ 'i' ] ) ) ? $mxDateTime[ 'i' ] : date( 'i' ) ) ) . ':' . ( ( isset( $mxDateTime[ 'second' ] ) ) ? $mxDateTime[ 'second' ] : ( ( isset( $mxDateTime[ 's' ] ) ) ? $mxDateTime[ 's' ] : date( 's' ) ) ); } elseif( is_integer( $mxDateTime ) ) { $mxDateTime = date( 'Y-m-d H:i:s' , $mxDateTime ); } else { if( ! is_string( $mxDateTime ) ) { $mxDateTime = date( 'Y-m-d H:i:s' ); } } $objCurrentTime = new DateTime(); $objTimeDifference = $objCurrentTime->diff( new DateTime( $mxDateTime ) ); $objTimeDifference->w = floor( $objTimeDifference->d / 7 ); $objTimeDifference->d -= $objTimeDifference->w * 7; if( ( is_bool( $bReturnAsArray ) ) && ( $bReturnAsArray ) ) { return array( 'year' => $objTimeDifference->y , 'y' => $objTimeDifference->y , 'month' => $objTimeDifference->m , 'm' => $objTimeDifference->m , 'week' => $objTimeDifference->w , 'w' => $objTimeDifference->w , 'day' => $objTimeDifference->d , 'd' => $objTimeDifference->d , 'hour' => $objTimeDifference->h , 'h' => $objTimeDifference->h , 'minute' => $objTimeDifference->i , 'i' => $objTimeDifference->i , 'second' => $objTimeDifference->s , 's' => $objTimeDifference->s ); } if( ! is_array( $arrLabelSet ) ) { $arrLabelSet = array( 'y' => 'year' , 'm' => 'month' , 'w' => 'week' , 'd' => 'day' , 'h' => 'hour' , 'i' => 'minute' , 's' => 'second' , 'ps' => 's' , 'px' => 'just now' ); } foreach( $arrLabelSet as $strKey => &$mxValue ) { if( strlen( $strKey ) > 1 ) { continue; } if( $objTimeDifference->$strKey ) { $mxValue = $objTimeDifference->$strKey . ' ' . $mxValue . ( $objTimeDifference->$strKey > 1 ? $arrLabelSet[ 'ps' ] : '' ); } else { $arrLabelSet[ $strKey ] = null; unset( $arrLabelSet[ $strKey ] ); } } $strPXTmp = $arrLabelSet[ 'px' ]; $arrLabelSet[ 'px' ] = null; unset( $arrLabelSet[ 'px' ] ); $arrLabelSet[ 'ps' ] = null; unset( $arrLabelSet[ 'ps' ] ); return ( $arrLabelSet ) ? implode( ', ' , $arrLabelSet ) : $strPXTmp; } ?>

 

We hope you find this API useful.

Best regards,
CI:A - Certus In Audio

Last changed: 04 Mar 2020

Back

RSS-Feed »

 


© 2020 CI:A - Certus In Audio
[Legal Disclosure] [Disclaimer]
[Privacy Statement] [T&C]
[Sitemap] [Contact] [Help/Infos] [Team] [Jobs]


Language: [en] [de] [de]
Font Size: [+] [-] [*]

Setting: [X] CSS | [X] JS | [X] SMM | [X] TT | [ ] PF



[Home] [HTTP] [QR Code] [Bar Code] [News Feed] [Word List] [Plain Text] [Content Only] [Files]



 |  | 

Online: 15 users | Hits: 4.519 (Today: 242)

WelcomeHelp/InfosLatest NewsPrivacy StatementSitemap
- statistics recorded since 05 Sep 2020 (15 days) -

Page generated in 0.04 seconds.
Waiting-Room: requests = 2 (1) | delay = 0 seconds

268.248.248 -