JiraRestApi\Issue\Worklog::setStarted PHP Method

setStarted() public method

Function to set start time of worklog.
public setStarted ( mixed $started )
$started mixed started time value(\DateTime|string) e.g. - new DateTime("2016-03-17 11:15:34") or "2016-03-17 11:15:34"
    public function setStarted($started)
    {
        if (is_string($started)) {
            $dt = new \DateTime($started);
        } elseif ($started instanceof \DateTime) {
            $dt = $started;
        } else {
            throw new JiraException('field only accept date string or DateTime class.' . get_class($started));
        }
        // workround micro second
        $this->started = $dt->format("Y-m-d\\TH:i:s") . '.000' . $dt->format('O');
        return $this;
    }