/** * Print date in standard DB format * * Set $tz parameter to false if you are sure that the date is in UTC. * * @param bool $tz do conversion to UTC * @return string */ function asDbDate($tz = true) { if ($tz) { if (empty(self::$_gmt)) { self::$_gmt = new DateTimeZone("UTC"); } $this->setTimezone(self::$_gmt); } return $this->format(TimeDate::DB_DATE_FORMAT); }