if (!empty($refreshGroupIDs)) {
$refreshGroupIDString = CRM_Core_DAO::escapeString(implode(', ', $refreshGroupIDs));
- $time = CRM_Utils_Date::getUTCTime('YmdHis', $smartGroupCacheTimeout * 60);
+ $time = CRM_Utils_Date::getUTCTime($smartGroupCacheTimeout * 60);
$query = "
UPDATE civicrm_group g
SET g.refresh_date = $time
$smartGroupCacheTimeout = self::smartGroupCacheTimeout();
$now = CRM_Utils_Date::getUTCTime();
- $refreshTime = CRM_Utils_Date::getUTCTime('YmdHis', $smartGroupCacheTimeout * 60);
+ $refreshTime = CRM_Utils_Date::getUTCTime($smartGroupCacheTimeout * 60);
if (!isset($groupID)) {
if ($smartGroupCacheTimeout == 0) {
return $format;
}
- static function getUTCTime($format = 'YmdHis', $offset = 0) {
+ /**
+ * Get the time in UTC for the current time. You can optionally send an offset from the current time if needed
+ *
+ * @param $offset int the offset from the current time in seconds
+ *
+ * @return the time in UTC
+ * @static
+ * @public
+ */
+ static function getUTCTime($offset = 0) {
$originalTimezone = date_default_timezone_get();
date_default_timezone_set('UTC');
$time = time() + $offset;