public static function getCurrentTime($string = FALSE, $showTime = FALSE) { $timezone = UsersHelper::getTimezone(); $current = new \DateTime(); $current->setTimezone(new \DateTimeZone($timezone)); if ($string) { $format = $showTime ? "Y-m-d H:i:s" : "Y-m-d"; return $current->format($format); } return $current; }