Windows OS - Setting time zone in testlink
Moderators: Amaradana, TurboPT, TL Developers
Windows OS - Setting time zone in testlink
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.
All test cases get wrong time stamps during creation or import/export.
Thanks.
Re: Windows OS - Setting time zone in testlink
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:
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.
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'
Also, make sure that the current system date/time is correct and not falling behind.
Re: Windows OS - Setting time zone in testlink
I have it in the same format but used " ". I'll try ' '. Thanks for replying.
Re: Setting time in testlink
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?
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?
Re: Windows OS - Setting time zone in testlink
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.
Re:Windows OS - Setting time zone in testlink
I don't know much about IIs7, but see if this information, or this information might be helpful for you.aostad wrote:...BTW, I'm using IIs7 (Not apache). Is it possible IIS doing something?
Re: Windows OS - Setting time zone in testlink
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.
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.
Re: Windows OS - Setting time zone in testlink
Issue opened http://mantis.testlink.org/view.php?id=5512
http://www.teamst.org/forum/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.
http://www.teamst.org/forum/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.
Re: Windows OS - Setting time zone in testlink
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
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
Re: Windows OS - Setting time zone in testlink
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");
}
}
}
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");
}
}
}
Re: Windows OS - Setting time zone in testlink
Thanks. I've tried it and it works.
Re: Windows OS - Setting time zone in testlink
BTW,You may want to associate issue 0005339, which marked as resolved, to this problem.
Re: Windows OS - Setting time zone in testlink
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 .
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! 

Re: Windows OS - Setting time zone in testlink
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");
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");
Re: Windows OS - Setting time zone in testlink
--------------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:Make sure to restart the web service after making any changes to this file.Code: Select all
date.timezone = 'America/New_York'
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.