phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: phpgwapi/inc class.datetime.inc.php,1.5.2.3,1.5.


From: Mark A Peters <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/inc class.datetime.inc.php,1.5.2.3,1.5.2.4
Date: Fri, 28 Jun 2002 22:07:36 -0400

Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv29493

Modified Files:
      Tag: Version-0_9_14-branch
        class.datetime.inc.php 
Log Message:
Changes to get even more accurate GMT/UTC epochs.

Index: class.datetime.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.datetime.inc.php,v
retrieving revision 1.5.2.3
retrieving revision 1.5.2.4
diff -C2 -r1.5.2.3 -r1.5.2.4
*** class.datetime.inc.php      23 Jun 2002 18:39:06 -0000      1.5.2.3
--- class.datetime.inc.php      29 Jun 2002 02:07:34 -0000      1.5.2.4
***************
*** 69,77 ****
                                {
                                        $line = 
$GLOBALS['phpgw']->network->bs_read_port(64);
!                                       // Value returned is 52384 02-04-20 
13:55:29 50 0 0   9.2 UTC(NIST) *
                                        
$GLOBALS['phpgw']->network->close_port();
                                
                                        $array = explode(' ',$line);
                                        
                                        if ($array[5] == 4)
                                        {
--- 69,93 ----
                                {
                                        $line = 
$GLOBALS['phpgw']->network->bs_read_port(64);
!                                       // host: 130.88.202.49
!                                       // Value returned is "Wed Jun 26 
00:32:26 2002"
                                        
$GLOBALS['phpgw']->network->close_port();
                                
                                        $array = explode(' ',$line);
+ 
+ //                                    if (sizeof($array) <> 5)
+ //                                    {
+ //                                            $error_occured = True;
+ //                                    }
+ //                                    else
+ //                                    {
+                                       // Convert to this format "15 Jul 2000 
20:50:22"
+ //                                            $temp_date = $array[2].' 
'.$array[1].' '.$array[4].' '.$array[3].' GMT';
+ //                                            $this->gmtnow = 
$this->convert_rfc_to_epoch($temp_date);
+ //                                    }
                                        
+                                       // host: 129.6.15.28
+                                       // Value returned is 52384 02-04-20 
13:55:29 50 0 0   9.2 UTC(NIST) *
+                                       echo 'Server datetime: 
'.time()."<br>\n";
+                                       echo 'Temporary NTP datetime: 
'.$line."<br>\n";
                                        if ($array[5] == 4)
                                        {
***************
*** 83,86 ****
--- 99,104 ----
                                                $time = explode(':',$array[2]);
                                                $this->gmtnow = 
mktime(intval($time[0]),intval($time[1]),intval($time[2]),intval($date[1]),intval($date[2]),intval($date[0])
 + 2000);
+                                               echo 'Temporary RFC epoch: 
'.$this->gmtnow."<br>\n";
+                                               echo 'GMT: '.date('Ymd 
H:i:s',$this->gmtnow)."<br>\n";
                                        }
                                }
***************
*** 106,113 ****
                                $this->gmtnow = 
$this->convert_rfc_to_epoch(gmdate('D, d M Y H:i:s',$server_time).' GMT');
                        }
  
                        
if(address@hidden($GLOBALS['phpgw_info']['server']['tz_offset']))
                        {
!                               $GLOBALS['phpgw_info']['server']['tz_offset'] = 
(($server_time - $this->gmtnow) / 3600);
                                
if(@isset($GLOBALS['phpgw_info']['server']['cache_phpgw_info']))
                                {
--- 124,133 ----
                                $this->gmtnow = 
$this->convert_rfc_to_epoch(gmdate('D, d M Y H:i:s',$server_time).' GMT');
                        }
+                       
+ //                    $this->gmtnow += (date('I') == 1?3600:0);
  
                        
if(address@hidden($GLOBALS['phpgw_info']['server']['tz_offset']))
                        {
!                               $GLOBALS['phpgw_info']['server']['tz_offset'] = 
intval(($server_time - $this->gmtnow) / 3600);
                                
if(@isset($GLOBALS['phpgw_info']['server']['cache_phpgw_info']))
                                {
***************
*** 119,126 ****
                                }
                        }
!                       $this->users_localtime = $this->gmtnow - 
$this->tz_offset;
  //                    echo '<!-- datetime::datetime::tz_offset = 
'.$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'].' 
-->'."\n";
  //                    echo '<!-- datetime::datetime::server:tz_offset = 
'.$GLOBALS['phpgw_info']['server']['tz_offset'].' -->'."\n";
  //                    echo '<!-- datetime::datetime::gmtnow = 
'.$this->gmtnow.' -->'."\n";
                }
  
--- 139,148 ----
                                }
                        }
!                       $this->users_localtime = $this->gmtnow + 
$this->tz_offset;
  //                    echo '<!-- datetime::datetime::tz_offset = 
'.$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'].' 
-->'."\n";
  //                    echo '<!-- datetime::datetime::server:tz_offset = 
'.$GLOBALS['phpgw_info']['server']['tz_offset'].' -->'."\n";
  //                    echo '<!-- datetime::datetime::gmtnow = 
'.$this->gmtnow.' -->'."\n";
+ //                    echo '<!-- datetime::datetime::GMT DateTime = 
'.date('Ymd H:i:s',$this->gmtnow).' -->'."\n";
+ //                    echo '<!-- datetime::datetime::Local DateTime = 
'.date('Ymd H:i:s',$this->users_localtime).' -->'."\n";
                }
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]