Webiny\Component\StdLib\StdObjectTrait::datetime PHP Method

datetime() protected static method

Create an instance of DateTime Standard Object.
protected static datetime ( string | integer $time = "now", null | string $timezone = null ) : DateTimeObject
$time string | integer A date/time string. List of available formats is explained here http://www.php.net/manual/en/datetime.formats.php
$timezone null | string Timezone in which you want to set the date. Here is a list of valid timezones: http://php.net/manual/en/timezones.php
return Webiny\Component\StdLib\StdObject\DateTimeObject\DateTimeObject
    protected static function datetime($time = "now", $timezone = null)
    {
        return new StdObject\DateTimeObject\DateTimeObject($time, $timezone);
    }