當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TimeDate::get_db_date_time_format方法代碼示例

本文整理匯總了PHP中TimeDate::get_db_date_time_format方法的典型用法代碼示例。如果您正苦於以下問題:PHP TimeDate::get_db_date_time_format方法的具體用法?PHP TimeDate::get_db_date_time_format怎麽用?PHP TimeDate::get_db_date_time_format使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TimeDate的用法示例。


在下文中一共展示了TimeDate::get_db_date_time_format方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testSwapDatetimeFormatToDbFormat

 /**
  * @ticket 17528
  */
 public function testSwapDatetimeFormatToDbFormat()
 {
     $date = '10-25-2007 12:00am';
     $format = $this->time_date->get_date_time_format();
     $db_format = $this->time_date->get_db_date_time_format();
     $this->assertEquals($this->time_date->swap_formats($date, 'm-d-Y h:ia', $this->time_date->get_db_date_time_format()), '2007-10-25 00:00:00');
 }
開發者ID:nickpro,項目名稱:sugarcrm_dev,代碼行數:10,代碼來源:TimeDateTest.php

示例2: GoogleCalls

 function GoogleCalls(&$bean, $event, $arguments)
 {
     echo "<br>aa " . $bean->id;
     echo "<br>aa " . $bean->name;
     echo "<br>sess delete " . $_SESSION["mass_upd_assigned"];
     echo "<br>sess delete" . $_REQUEST["massupdate"];
     echo "<br>";
     $okev = true;
     $_SESSION["mass_upd_assigned"] = false;
     if (isset($_REQUEST["massupdate"])) {
         if ($_REQUEST["massupdate"] == true) {
             $okev = false;
             if ($_REQUEST['assigned_user_id'] != "" or $_REQUEST['date_start'] != "") {
                 $okev = true;
             }
             if ($_REQUEST['assigned_user_id'] != "") {
                 $_SESSION["mass_upd_assigned"] = true;
             }
         }
     }
     if ($okev == true) {
         if ($_SESSION["called_from_sync"] == false or $_SESSION["called_from_sync"] == "") {
             ### skip if called from sync.php logic hook
             echo "<br>delete from sugar logic hook ";
             global $timedate;
             $offset_val = ".000+02:00";
             $td = new TimeDate();
             echo "<br>old bean id " . $bean->id;
             echo "<br>old bean name " . $bean->name;
             echo "<br>tablename ";
             $tablename = $bean->table_name;
             $a = $response['list'][$tn1];
             $s = array();
             $s["title"] = $bean->name;
             if ($tablename == 'meetings') {
                 $s["title"] = "Meeting: " . $s["title"];
             }
             if ($tablename == 'calls') {
                 $s["title"] = "Call: " . $s["title"];
             }
             if ($tablename == 'tasks') {
                 $s["title"] = "Task: " . $s["title"];
             }
             echo "<br>bean date start " . $bean->date_start;
             $s["content"] = $bean->description;
             $s["where"] = $bean->location;
             $s["startDay"] = $bean->date_start;
             $s["startTime"] = $bean->time_start;
             $s["endDay"] = $bean->date_end;
             $s["reminder_time"] = $bean->reminder_time / 60;
             if ($s["reminder_time"] == '' or $s["reminder_time"] == 0) {
                 $s["reminder_time"] = 10;
             }
             if ($bean->date_start == '' and $bean->date_due != "") {
                 $s["startDay"] = $bean->date_due;
                 #### for tasks if no start date
             } else {
                 $s["startDay"] = $bean->date_start;
             }
             #   print_r($s);
             global $current_user;
             $pd = $s["startDay"];
             ####260608
             #$pd= $td->handle_offset($td->get_date_time_format(true, $current_user), $td->get_date_time_format(true, $current_user), false,$current_user);
             $date_start_in_db_fmt = $td->swap_formats($s["startDay"], $td->get_date_time_format(true, $current_user), $td->get_db_date_time_format());
             $date_end_in_db_fmt1 = $td->swap_formats($bean->date_due, $td->get_date_time_format(true, $current_user), $td->get_db_date_time_format());
             $date_start_array = split(" ", trim($date_start_in_db_fmt));
             $date_time_start = DateTimeUtil::get_time_start($date_start_array[0], $date_start_array[1]);
             $tt1 = $td->to_display_date_time($bean->date_start, true, true, false);
             $user = $current_user;
             $s["startTime"] = $td->handle_offset($date_start_in_db_fmt, "H:i:s", false, $current_user);
             $date_end_in_db_fmt1 = $td->handle_offset($date_end_in_db_fmt1, "Y-m-d H:i:s", false, $current_user);
             echo "<br>bean date start1 " . $s["startTime"];
             ##260806 $s["startTime"]=$date_start_array[1];
             echo "<br>bean date start2 " . $s["startTime"];
             $ch = explode(" ", $s["startDay"]);
             if ($ch['1'] == "00:00" or $ch['1'] == "00.00") {
                 #### 120608 bogdan if task and 12:00 goes to next day $s["startDay"]  = $td->handle_offset($date_start_in_db_fmt, "Y-m-d", false,$current_user);
                 $s["startDay"] = $td->handle_offset($date_start_in_db_fmt, "Y-m-d", false, $current_user);
                 $s["startDay1"] = $td->handle_offset($date_start_in_db_fmt, "Y-m-d H:i:s", false, $current_user);
             } else {
                 $s["startDay"] = $td->handle_offset($date_start_in_db_fmt, "Y-m-d", false, $current_user);
                 $s["startDay1"] = $td->handle_offset($date_start_in_db_fmt, "Y-m-d H:i:s", false, $current_user);
             }
             $plugin_format = "d/m/Y H:i";
             if ($td->get_date_time_format(true, $current_user) != $plugin_format) {
                 ##260608 $plugin_date_start=$td->swap_formats($pd, $td->get_date_time_format(true, $current_user),  $plugin_format);
                 $plugin_date_due = $td->swap_formats($bean->date_due, $td->get_date_time_format(true, $current_user), $plugin_format);
             } else {
                 ##260608  $plugin_date_start=$pd;
                 $plugin_date_due = $bean->date_due;
             }
             $plugin_date_start = $td->swap_formats($s["startDay1"], "Y-m-d H:i:s", $plugin_format);
             $plugin_date_due1 = $td->swap_formats($date_end_in_db_fmt1, "Y-m-d H:i:s", $plugin_format);
             echo "<br>plg date start " . $plugin_date_start;
             #################################################
             $d1 = explode("/", $plugin_date_start);
             global $current_user;
             $d1[2] = explode(" ", $d1[2]);
             $d1[2] = $d1[2][0];
//.........這裏部分代碼省略.........
開發者ID:Terradex,項目名稱:sugar,代碼行數:101,代碼來源:before_delete_google.php

示例3: GoogleCalls

 function GoogleCalls(&$bean, $event, $arguments)
 {
     $okev = true;
     $_SESSION["mass_upd_assigned"] = false;
     if (isset($_REQUEST["massupdate"])) {
         if ($_REQUEST["massupdate"] == true) {
             $okev = false;
             if ($_REQUEST['assigned_user_id'] != "" or $_REQUEST['date_start'] != "") {
                 $okev = true;
             }
             if ($_REQUEST['assigned_user_id'] != "") {
                 $_SESSION["mass_upd_assigned"] = true;
             }
         }
     }
     if ($okev == true) {
         if ($_SESSION["called_from_sync"] == false or $_SESSION["called_from_sync"] == "") {
             ### skip if called from sync.php logic hook
             global $timedate;
             $offset_val = ".000+02:00";
             $td = new TimeDate();
             $tablename = $bean->table_name;
             $a = $response['list'][$tn1];
             $s = array();
             #  echo "<br>**********Event ******* id=$a[id] ***** name=$a[name]";
             $s["title"] = $bean->name;
             if ($tablename == 'meetings') {
                 $s["title"] = "Meeting: " . $s["title"];
             }
             if ($tablename == 'calls') {
                 $s["title"] = "Call: " . $s["title"];
             }
             if ($tablename == 'tasks') {
                 $s["title"] = "Task: " . $s["title"];
             }
             $s["content"] = $bean->description;
             $s["where"] = $bean->location;
             $s["startDay"] = $bean->date_start;
             $s["startTime"] = $bean->time_start;
             $s["endDay"] = $bean->date_end;
             $s["reminder_time"] = $bean->reminder_time / 60;
             if ($s["reminder_time"] == '' or $s["reminder_time"] == 0) {
                 $s["reminder_time"] = 10;
             }
             if ($bean->date_start == '' and $bean->date_due != "") {
                 $s["startDay"] = $bean->date_due;
                 #### for tasks if no start date
             } else {
                 $s["startDay"] = $bean->date_start;
             }
             #   print_r($s);
             global $current_user;
             $pd = $s["startDay"];
             ####260608
             #$pd= $td->handle_offset($td->get_date_time_format(true, $current_user), $td->get_date_time_format(true, $current_user), false,$current_user);
             $date_start_in_db_fmt = $td->swap_formats($s["startDay"], $td->get_date_time_format(true, $current_user), $td->get_db_date_time_format());
             $date_end_in_db_fmt1 = $td->swap_formats($bean->date_due, $td->get_date_time_format(true, $current_user), $td->get_db_date_time_format());
             $date_start_array = split(" ", trim($date_start_in_db_fmt));
             $date_time_start = DateTimeUtil::get_time_start($date_start_array[0], $date_start_array[1]);
             $tt1 = $td->to_display_date_time($bean->date_start, true, true, false);
             $user = $current_user;
             $s["startTime"] = $td->handle_offset($date_start_in_db_fmt, "H:i:s", false, $current_user);
             $date_end_in_db_fmt1 = $td->handle_offset($date_end_in_db_fmt1, "Y-m-d H:i:s", false, $current_user);
             ###### problem with offset ... if record is at 23.15 gmt +2 .. date problem
             $ch = explode(" ", $s["startDay"]);
             if ($ch['1'] == "00:00" or $ch['1'] == "00.00") {
                 #### 120608 bogdan if task and 12:00 goes to next day $s["startDay"]  = $td->handle_offset($date_start_in_db_fmt, "Y-m-d", false,$current_user);
                 $s["startDay"] = $td->handle_offset($date_start_in_db_fmt, "Y-m-d", false, $current_user);
                 $s["startDay1"] = $td->handle_offset($date_start_in_db_fmt, "Y-m-d H:i:s", false, $current_user);
             } else {
                 $s["startDay"] = $td->handle_offset($date_start_in_db_fmt, "Y-m-d", false, $current_user);
                 $s["startDay1"] = $td->handle_offset($date_start_in_db_fmt, "Y-m-d H:i:s", false, $current_user);
             }
             $plugin_format = "d/m/Y H:i";
             if ($td->get_date_time_format(true, $current_user) != $plugin_format) {
                 ##260608 $plugin_date_start=$td->swap_formats($pd, $td->get_date_time_format(true, $current_user),  $plugin_format);
                 $plugin_date_due = $td->swap_formats($bean->date_due, $td->get_date_time_format(true, $current_user), $plugin_format);
             } else {
                 ##260608  $plugin_date_start=$pd;
                 $plugin_date_due = $bean->date_due;
             }
             $plugin_date_start = $td->swap_formats($s["startDay1"], "Y-m-d H:i:s", $plugin_format);
             $plugin_date_due1 = $td->swap_formats($date_end_in_db_fmt1, "Y-m-d H:i:s", $plugin_format);
             #################################################
             $d1 = explode("/", $plugin_date_start);
             global $current_user;
             $d1[2] = explode(" ", $d1[2]);
             $d1[2] = $d1[2][0];
             if ($bean->time_start != '' and 1 == 2) {
                 $t1 = explode(":", $bean->time_start);
             } else {
                 $fort1 = explode(" ", $plugin_date_start);
                 $fort1 = $fort1[1];
                 $t1 = explode(":", $fort1);
             }
             $t1[1] = round($t1[1]);
             $untill = mktime($t1[0] + $bean->duration_hours, $t1[1] + $bean->duration_minutes, $t1[2], $d1[1], $d1[0], $d1[2]);
             if ($tablename == 'tasks') {
                 if ($plugin_date_due == "" or $bean->date_due == "") {
                     $forexp = $plugin_date_start;
//.........這裏部分代碼省略.........
開發者ID:Terradex,項目名稱:sugar,代碼行數:101,代碼來源:google_calendar_plg.php


注:本文中的TimeDate::get_db_date_time_format方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。