Mailgun\Messages\MessageBuilder::setDeliveryTime PHP Method

setDeliveryTime() public method

public setDeliveryTime ( string $timeDate, string | null $timeZone = null ) : string
$timeDate string
$timeZone string | null
return string
    public function setDeliveryTime($timeDate, $timeZone = null)
    {
        if (isset($timeZone)) {
            $timeZoneObj = new \DateTimeZone("{$timeZone}");
        } else {
            $timeZoneObj = new \DateTimeZone(Api::DEFAULT_TIME_ZONE);
        }
        $dateTimeObj = new \DateTime($timeDate, $timeZoneObj);
        $formattedTimeDate = $dateTimeObj->format(\DateTime::RFC2822);
        $this->message['o:deliverytime'] = $formattedTimeDate;
        return $this->message['o:deliverytime'];
    }