CAdvBanner::CalculateTimeProgress: Bitrix method

      
<?php 
//  CAdvBanner :: CalculateTimeProgress()
//  /dist/bitrix/modules/advertising/classes/general/advertising.php:3960

    
public static function CalculateTimeProgress($arBanner)
    {
        
$dt CAdvBanner_all::__innerExtractBitrixDates($arBanner);

        
$stmpnow time();
        
$dtformat "DD.MM.YYYY HH:MI:SS";
        
$stmpfirst MakeTimeStamp($dt["first"], $dtformat);
        
$stmpfrom MakeTimeStamp($dt["from"], $dtformat);
        
$stmpto MakeTimeStamp($dt["to"], $dtformat);

        
// Check if FirstShowDate valid, then use it.
        
if ($stmpfirst>and $stmpfirst>=$stmpfrom and $stmpto>$stmpfirst)
        {
            
$stmpfrom $stmpfirst;
        }

        
$stmpnow -= $stmpfrom;
        
$diff CAdvBanner_all::CalculateTimeDiff($arBanner);
        if (
$stmpnow <= or !$diff) return 0;

        return 
$stmpnow/$diff;
    }