Bug #66793

Updated by Sybille Peters about 4 years ago

The entered time in the text field "simulate time" is evaluated as UTC / GMT even though a different timezone is set on client + server machine (CEST / "Europe/Berlin").  

 This problem exists in 4.5.40 and 6.2.12. 


 h1. 

 The problem probably exists in the Javascript Code running on the client side (should respect client's timezone).  

 More info: 
 ========== 

 setup 
 ===== 

 server: 
 ------- 

 php.ini: 
 <pre><code class="php"> 
 date.timezone = "Europe/Berlin" 
 </code></pre> 


 

 System timezone: CEST 

 LocalConfiguration.php 

 LocalConfiguration.php: 

 <pre><code class="php"> 
          'phpTimeZone' => 'Europe/Berlin', 
 LocalConfiguration.php:          'serverTimeZone' => '2', 


 client: 
 ------- 

 </code></pre> 

 h1. System timezone: CEST 


 reproduce + debug information 
 =============================== 

 # Set 1) set allowed time from 9:00 to 10:00 for a page (e.g. 9:00 5-5-2015) 
 # Enter 

 2) enter 7:18 in "simulate time" in admin panel (for the same day, copy date format from backend):  

 h1. Result 

 Allowed content (9:00 to 10:00) URL is displayed for entered time of 7:18 > not correct created: 
 TSFE_ADMIN_PANEL[preview_simulateDate]_hr=7:18 5-5-2015 
 TSFE_ADMIN_PANEL[preview_simulateDate]=1430810280 

 h1. 1430810280 = 
 date --date="@1430810280" -u 
 Tue May    5 07:18:00 UTC 2015 

  date --date="@1430810280" 
 Tue May    5 09:18:00 CEST 2015 

 conclusion:  

 "simulate time" in admin-panel is evaluated as UTC (it does not use current timezone) 


 h1. 

 3) Look at configuration in Backend: 
 $GLOBALS['BE_USER']->uc 
  TSFE_adminConfig->[preview_simulateDate]=1430810280 

 4) 

 result: allowed content (9:00 to 10:00) is displayed for entered time of 7:18 > not correct 

 Test (simulate time) 
 ==================== 

 entered time for content: 6:00 - 9:00 

 entered time in "simulate time" in admin panel: 

 3:00 : content not visible 
 4:00 : content visisble 
 5:00 : content visible 
 6:00 : content visible 
 6:59 : content visisble 
 7:00 : content not visisble 


 +2 hours offset

Back