Windows OS - Setting time zone in testlink

Moderators: Amaradana, TurboPT, TL Developers

Windows OS - Setting time zone in testlink

Postby aostad » Fri Jan 18, 2013 7:26 pm

I have set the time in PHP.ini file but not sure if there is any configuration in Testlink too.
All test cases get wrong time stamps during creation or import/export.
Thanks.
aostad
Member of TestLink Community
 
Posts: 183
Joined: Wed Apr 01, 2009 8:32 pm

Re: Windows OS - Setting time zone in testlink

Postby TurboPT » Sat Jan 19, 2013 3:58 pm

No other date/time setting within TestLink that I know...

It is not clear what was changed in the php.ini file, but make sure this setting in php.ini is correct for your locale:
Code: Select all
date.timezone = 'America/New_York'

Make sure to restart the web service after making any changes to this file.

Also, make sure that the current system date/time is correct and not falling behind.
TurboPT
Member of TestLink Community
 
Posts: 337
Joined: Sun Dec 10, 2006 4:51 am

Re: Windows OS - Setting time zone in testlink

Postby aostad » Sat Jan 19, 2013 5:59 pm

I have it in the same format but used " ". I'll try ' '. Thanks for replying.
aostad
Member of TestLink Community
 
Posts: 183
Joined: Wed Apr 01, 2009 8:32 pm

Re: Setting time in testlink

Postby aostad » Mon Jan 21, 2013 4:44 am

Unfortunately, it doesn't work. I even configured
date.default_latitude
date.default_longitude

It looks like somehow the date and time get overwritten by some default settings. Date/time is correct in log file but is not right in testlink pages.

BTW, I'm using IIs7 (Not apache). Is it possible IIS doing something?
aostad
Member of TestLink Community
 
Posts: 183
Joined: Wed Apr 01, 2009 8:32 pm

Re: Windows OS - Setting time zone in testlink

Postby aostad » Mon Jan 21, 2013 6:44 am

BTW, When I set the date.timezone=America/Los_Angeles, the time in Test Specification page is 8 hours behind, while "Events" page shows right time.
aostad
Member of TestLink Community
 
Posts: 183
Joined: Wed Apr 01, 2009 8:32 pm

Re:Windows OS - Setting time zone in testlink

Postby TurboPT » Tue Jan 22, 2013 1:57 am

aostad wrote:...BTW, I'm using IIs7 (Not apache). Is it possible IIS doing something?

I don't know much about IIs7, but see if this information, or this information might be helpful for you.
TurboPT
Member of TestLink Community
 
Posts: 337
Joined: Sun Dec 10, 2006 4:51 am

Re: Windows OS - Setting time zone in testlink

Postby aostad » Tue Jan 22, 2013 2:54 am

Thanks for replying.
These information is about the format of date. The problem that I'm encountering is wrong calculation of time.For example, when I set date.timezone=America/Los_Angelese and curren time is 22:00:00, the time of created test case shows 14:00:00. That means testlink shows it 8 hours behind, while the time stamp for PHP logged messages is right.
aostad
Member of TestLink Community
 
Posts: 183
Joined: Wed Apr 01, 2009 8:32 pm

Re: Windows OS - Setting time zone in testlink

Postby fman » Sat Feb 02, 2013 9:21 am

Issue opened http://mantis.testlink.org/view.php?id=5512
viewtopic.php?f=42&t=7213

more info that may be can help
http://www.sqlhacks.com/Dates/UTC-Dates
http://blog.mikecouturier.com/2009/12/t ... tml#tz_app
http://stackoverflow.com/questions/3467 ... nes-in-php

did some tests on Windows 7 with MSSQL 2008 express, issue is that MSSQL stores date/time using server TIMEZONE (I've read about this in internet) , then seems it always convert date/time we pass from PHP. <b> BAD/WRONG CONCLUSION, new tests provide other info</b>
One issue probably we will have when USING DEFAULTS on date/time columns is that if DBSERVER TIMEZONE is NOT ALIGNED with PHP time zone we are going
to have issues with date/time.

This behaviour is different to what MySQL do (at least if you use standard installation with XAMPP) where DB accept and use what is provided without doing any transformation.
fman
Member of TestLink Community
 
Posts: 3051
Joined: Tue Nov 15, 2005 7:19 am

Re: Windows OS - Setting time zone in testlink

Postby fman » Sat Feb 02, 2013 12:05 pm

Issue seems related to date formatted as strings returned from ADODB for MSSQL

MSSQL
["creation_ts"]=> string(20) "2013-02-02T08:27:44Z"
["modification_ts"]=> string(20) "2013-02-02T08:29:00Z"

MySQL
["creation_ts"]=> string(20) "2013-02-02 08:27:44" => No T, No Z
["modification_ts"]=> string(20) "2013-02-02 08:29:00"

when the function that localize dates (on lang_api.php) uses strtotime() the issue arise.

Solution (to be fully tested) will be remove T and Z from string
fman
Member of TestLink Community
 
Posts: 3051
Joined: Tue Nov 15, 2005 7:19 am

Re: Windows OS - Setting time zone in testlink

Postby fman » Sat Feb 02, 2013 5:43 pm

Here the same findings
http://www.deepshiftlabs.com/dev_blog/? ... lang=en-us

an excerpt

I want to draw your attention to the fact that the new Microsoft driver returns datetime as PHP DateTime:: object. But we use ADODB, which does this little trick converting this object into a string on line 794 of adodb-mssqlnative.inc.php file:
View Code PHP

$this->fields[$key] = $value->format("Y-m-d\TH:i:s\Z");

Thus, returning us the string ’2012-08-22T23:42:22Z ‘instead of the usual ’2012-08-22 23:42:22′ and so for backward compatibility, you can correct adodb-mssqlnative.inc.php this way:
View Code PHP

if(is_array($this->fields)) {
foreach($this->fields as $key=>$value) {
if (is_object($value) && method_exists($value, 'format')) {//is DateTime object
//$this->fields[$key] = $value->format("Y-m-d\TH:i:s\Z");
//DSL DateTime output format fix
$this->fields[$key] = $value->format("Y-m-d H:i:s");
}
}
}
fman
Member of TestLink Community
 
Posts: 3051
Joined: Tue Nov 15, 2005 7:19 am

Re: Windows OS - Setting time zone in testlink

Postby aostad » Wed Feb 06, 2013 4:15 pm

Thanks. I've tried it and it works.
aostad
Member of TestLink Community
 
Posts: 183
Joined: Wed Apr 01, 2009 8:32 pm

Re: Windows OS - Setting time zone in testlink

Postby aostad » Wed Feb 06, 2013 4:20 pm

BTW,You may want to associate issue 0005339, which marked as resolved, to this problem.
aostad
Member of TestLink Community
 
Posts: 183
Joined: Wed Apr 01, 2009 8:32 pm

Re: Windows OS - Setting time zone in testlink

Postby abrjib0 » Thu Feb 07, 2013 4:41 am

Sorry guys, is there anyway I can fix it in my system as I am having this issue here.
I am in timezone (UTC+08:00) Perth. Installed TestLink using BitNami stack.
Sorry if it has been already explained .
New to TL and finding it GREAT! :-)
abrjib0
TestLink user
 
Posts: 8
Joined: Thu Jan 31, 2013 7:42 pm

Re: Windows OS - Setting time zone in testlink

Postby aostad » Thu Feb 07, 2013 6:43 pm

As it's been said, in file "third_party\adodb\drivers\adodb-mssqlnative.inc.php"
replace this:
$this->fields[$key] = $value->format("Y-m-d\TH:i:s\Z");

with this:
$this->fields[$key] = $value->format("Y-m-d H:i:s");
aostad
Member of TestLink Community
 
Posts: 183
Joined: Wed Apr 01, 2009 8:32 pm

Re: Windows OS - Setting time zone in testlink

Postby Ferhan » Thu Dec 28, 2017 11:17 am

TurboPT wrote:No other date/time setting within TestLink that I know...

It is not clear what was changed in the php.ini file, but make sure this setting in php.ini is correct for your locale:
Code: Select all
date.timezone = 'America/New_York'

Make sure to restart the web service after making any changes to this file.

Also, make sure that the current system date/time is correct and not falling behind.


--------------
Where can I find PHP.ini file? I searched in Testlink folder but no luck.
Ferhan
TestLink user
 
Posts: 1
Joined: Sun Dec 24, 2017 6:51 pm

Next

Return to Windows OS



Who is online

Users browsing this forum: No registered users and 1 guest