CRM-13737 drupal integration - Use basename fn to extract last dir in the url as...
[civicrm-core.git] / CRM / Utils / System / Base.php
index 93cd88b0c3f7e49b9549dc0d30cd7c125658bde4..e9acb7df1a1e9e58a8b0969715213585f344cb13 100644 (file)
@@ -163,5 +163,23 @@ abstract class CRM_Utils_System_Base {
    */
   function userLoginFinalize($params = array()){
   }
+
+  /**
+   * Set timezone in mysql so that timestamp fields show the correct time
+   */
+  function setMySQLTimeZone(){
+    $timeZoneOffset = $this->getTimeZoneOffset();
+    if($timeZoneOffset){
+      $sql = "SET time_zone = '$timeZoneOffset'";
+      CRM_Core_DAO::executequery($sql);
+    }
+  }
+
+  /**
+   * Get timezone from CMS
+   * @return boolean|string
+   */
+  function getTimeZoneOffset(){
+  }
 }