step date, return updated date, array and timpstamp

@author Kjell-Inge Gustafsson <ical@kigkonsult.se>
@since 2.2.15 - 2007-11-12
@param array $date, date to step
@param int $timestamp
@param array $step, default array( 'day' => 1 )
@return void
431796
function _stepdate( &$date, &$timestamp, $step=array( 'day' => 1 )) {
    foreach( $step as $stepix => $stepvalue )
      $date[$stepix] += $stepvalue;
    $timestamp  = $this->_date2timestamp( $date );
    $date       = $this->_date_time_string( date('Y-m-d H:i:s', $timestamp ), 6);
    foreach( $date as $k => $v ) {
      if( ctype_digit( $v ))
        $date[$k] = (int) $v;
    }
  }
86853
public function increment($key, $step)
    {
        $value = $this->getValueByKey($key, false);
        $this->alter($key, $value + $step);
    }
688263
@Override
    public LocalDate adjustDate(LocalDate startDate, int increment, NonWorkingDayChecker<LocalDate> checker) {
        LocalDate date = startDate;
        final int month = date.getMonthValue();
        int stepToUse = increment;
        while (checker.isNonWorkingDay(date)) {
            date = date.plusDays(stepToUse);
            if (date.getMonthValue() != month) {
                // flick to backward
                stepToUse *= -1;
                date = date.plusDays(stepToUse);
            }
        }
        return date;
    }
951193
function setTimestamp(?int $timestamp = null) {
        $this->timestamp = (new \DateTime(($timestamp !== null ? '@'.$timestamp : 'now')))->format('c');
        return $this;
    }
858109
public static function roundTimestampToDay($timestamp)
    {
        $day   = date('d', $timestamp);
        $month = date('m', $timestamp);
        $year  = date('Y', $timestamp);
        
        $roundedTimestamp = mktime(0, 0, 0, $month, $day, $year);
        
        return $roundedTimestamp;
    }
1085392
public function executeStep($stepAction, &$stepActionParams, &$options, array &$context)
    {
        return $this->getConfHelper()->executeStep($stepAction, $stepActionParams, $options, $context);
    }
1281296
public function getDay($timestamp = false)
    {
        if (!$timestamp) {
            $timestamp = $this->dateTime->getTimestamp();
        }

        return date('j', $timestamp);
    }
1356095
public function markFinished(StepInterface $step, $actionId, DateTime $finishDate, $status, $caller)
    {
        $entryId = $step->getEntryId();
        $currentSteps = $this->findCurrentSteps($entryId);

        foreach ($currentSteps as $theStep) {
            if ($theStep->getId() === $step->getId()) {
                $theStep->setStatus($status);
                $theStep->setActionId($actionId);
                $theStep->setFinishDate($finishDate);
                $theStep->setCaller($caller);

                return $theStep;
            }
        }

        return null;
    }
1006888
public static function pf_date_assoc($from, $to, $default = null, $step = '+1 day', $outputFormat = 'Y-m-d')
    {
        $dates = self::pf_date_indexed($from, $to, $step, $outputFormat);
        return array_fill_keys($dates, $default);
    }
1225648
public PactDslJsonArray timestamp(String format, Date example) {
        FastDateFormat instance = FastDateFormat.getInstance(format);
        body.put(instance.format(example));
        matchers.addRule(rootPath + appendArrayIndex(0), matchTimestamp(format));
        return this;
    }
414104
public function setTimeStep($timeStep)
    {
        $timeStep = abs(intval($timeStep));
        $this->timeStep = $timeStep;

        return $this;
    }
859484
public function createCurrentStep($entryId, $stepId, $owner = null, DateTime $startDate, DateTime $dueDate = null, $status, array $previousIds = [])
    {
        $id = static::$globalStepId++;
        $step = new SimpleStep($id, $entryId, $stepId, 0, $owner, $startDate, $dueDate, null, $status, $previousIds, null);

        if (!array_key_exists($entryId, static::$currentStepsCache)) {
            $currentSteps = new SplObjectStorage();
            static::$currentStepsCache[$entryId] = $currentSteps;
        }


        static::$currentStepsCache[$entryId]->attach($step);

        return $step;
    }
1314895
function OffsetDate($dayFraction, $date=false)
	{
		if (!$date) {
			$date = $this->sysDate;
		}

		$fraction = $dayFraction * 24 * 3600;
		return $date . ' + INTERVAL ' .	$fraction . ' SECOND';
//		return "from_unixtime(unix_timestamp($date)+$fraction)";
	}
270829
def laggeddates(ts, step=1):
    ''''''
    if step == 1:
        dates = ts.dates()
        if not hasattr(dates, 'next'):
            dates = dates.__iter__()
        dt0 = next(dates)
        for dt1 in dates:
            yield dt1, dt0
            dt0 = dt1
    else:
        while done:
            done += 1
            lag.append(next(dates))
        for dt1 in dates:
            lag.append(dt1)
            yield dt1, lag.pop(0)
400480
public function setStepStore( $step, array $data )
    {
        $store  = $this->getStore();
        $steps  = $store['steps'];
        $step   = (string) $step;
        $steps[$step]   = $data;
        $store['steps'] = $steps;
        return $this;
    }
550466
public function increment($key, $step = 1)
    {
        $value = $this->get($key);
        $this->set($key, $value + $step);
    }
227231
public function calculateStepWidth(StepNode $step, $indentation)
    {
        $indentText = str_repeat(' ', intval($indentation));

        $text = sprintf('%s%s %s', $indentText, $step->getKeyword(), $step->getText());

        return mb_strlen($text, 'utf8');
    }