Common\Core\Model::getUTCDate PHP Method

getUTCDate() public static method

Get the UTC date in a specific format. Use this method when inserting dates in the database!
public static getUTCDate ( string $format = null, integer $timestamp = null ) : string
$format string The format to return the timestamp in. Default is MySQL datetime format.
$timestamp integer The timestamp to use, if not provided the current time will be used.
return string
    public static function getUTCDate($format = null, $timestamp = null)
    {
        $format = $format !== null ? (string) $format : 'Y-m-d H:i:s';
        if ($timestamp === null) {
            return gmdate($format);
        }
        return gmdate($format, (int) $timestamp);
    }