当前位置: 首页>>代码示例>>PHP>>正文


PHP TimeDate::getDSTRange方法代码示例

本文整理汇总了PHP中TimeDate::getDSTRange方法的典型用法代码示例。如果您正苦于以下问题:PHP TimeDate::getDSTRange方法的具体用法?PHP TimeDate::getDSTRange怎么用?PHP TimeDate::getDSTRange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TimeDate的用法示例。


在下文中一共展示了TimeDate::getDSTRange方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

 $rDblCheck = $db->query($qDone);
 $rowsDblCheck = $db->getRowCount($rDblCheck);
 if ($rowsDblCheck < 1) {
     // majed's sql generation
     $tables = array('calls' => array('date_start' => 'time_start'), 'meetings' => array('date_start' => 'time_start'), 'tasks' => array('date_due' => 'time_due'), 'project_task' => array('date_due' => 'time_due'), 'email_marketing' => array('date_start' => 'time_start'), 'emailman' => array('send_date_time' => 'datetime'));
     $zone = $_REQUEST['server_timezone'];
     $td = new TimeDate();
     $startyear = 2004;
     $maxyear = 2014;
     $date_modified = gmdate($GLOBALS['timedate']->get_db_date_time_format());
     $display = '';
     foreach ($tables as $table_name => $table) {
         //$display .=  '<B>'. $table_name . '</b><BR>';
         $year = $startyear;
         for ($year = $startyear; $year <= $maxyear; $year++) {
             $range = $td->getDSTRange($year, $timezones[$zone]);
             $startDateTime = explode(' ', $range['start']);
             $endDateTime = explode(' ', $range['end']);
             if ($range) {
                 if (strtotime($range['start']) < strtotime($range['end'])) {
                     foreach ($table as $date => $time) {
                         $interval = 'PLUSMINUS INTERVAL 3600 second';
                         if ($time != 'datetime') {
                             if ($db->dbType == 'mysql' or $db->dbType == 'oci8') {
                                 $field = "CONCAT({$table_name}.{$date},' ', {$table_name}.{$time})";
                             }
                             if ($db->dbType == 'mssql') {
                                 $field = "{$table_name}.{$date} + ' ' + {$table_name}.{$time}";
                             }
                             $updateBase = "UPDATE  {$table_name} SET date_modified='{$date_modified}', {$table_name}.{$date}=LEFT({$field} {$interval},10),";
                             $updateBase .= " {$table_name}.{$time}=RIGHT({$field} {$interval},8)";
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:DstFix.php

示例2: getUserConfigJSON

function getUserConfigJSON()
{
    require_once 'include/TimeDate.php';
    $td = new TimeDate();
    global $current_user, $global_registry_var_name, $json, $_SESSION, $sugar_config;
    if (isset($_SESSION['authenticated_user_theme']) && $_SESSION['authenticated_user_theme'] != '') {
        $theme = $_SESSION['authenticated_user_theme'];
    } else {
        $theme = $sugar_config['default_theme'];
    }
    $user_arr = array();
    $user_arr['theme'] = $theme;
    $user_arr['fields'] = array();
    $user_arr['module'] = 'User';
    $user_arr['fields']['id'] = $current_user->id;
    $user_arr['fields']['user_name'] = $current_user->user_name;
    $user_arr['fields']['first_name'] = $current_user->first_name;
    $user_arr['fields']['last_name'] = $current_user->last_name;
    $user_arr['fields']['email'] = $current_user->email1;
    $userTz = $td->getUserTimeZone();
    $dstRange = $td->getDSTRange(date('Y'), $userTz);
    $user_arr['fields']['dst_start'] = $dstRange['start'];
    $user_arr['fields']['dst_end'] = $dstRange['end'];
    $user_arr['fields']['gmt_offset'] = $userTz['gmtOffset'];
    $str = "\n" . $global_registry_var_name . ".current_user = " . $json->encode($user_arr) . ";\n";
    return $str;
}
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:27,代码来源:json_server.php


注:本文中的TimeDate::getDSTRange方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。