how to localize the timezone?

Ask community to help.

Moderators: Amaradana, TurboPT, TL Developers

Post Reply
bestrick
TestLink user
Posts: 5
Joined: Fri Feb 11, 2011 2:13 am

how to localize the timezone?

Post by bestrick »

I use testlink 1.8.5 version,now I found my testlink is 8 hours later than my time,so I guess the default time zone of testlink is GMT.
I tryed to change the configration here,but it does not work.Can you tell me how to localize the time displayed?Thanks!

/** [LOCALIZATION] */

/** Default localization for users */
// The value must be available in $g_locales (see cfg/const.inc.php).
// Note: An attempt will be done to establish the default locale
// automatically using $_SERVER['HTTP_ACCEPT_LANGUAGE']
$tlCfg->default_language = 'en_GB';



// --------------------------------------------------------------------------------------
/** [LOCALIZATION] */

/** String that will used as prefix, to generate an string when a label to be localized
* is passed to lang_get() to be translated, by the label is not present in the strings file.
* The resulting string will be: TL_LOCALIZE_TAG . label
* Example: code specifies the key of string: lang_get('hello') -> shows "LOCALIZE: Hello"
*/
define('TL_LOCALIZE_TAG',"LOCALIZE: ");

/**
* List of supported localizations (used in user preferences to choose one)
**/
// Please mantain the alphabetical order when adding new locales.
$g_locales = array(
'cs_CZ' => 'Czech',
'de_DE' => 'German',
'en_GB' => 'English (wide/UK)',
'en_US' => 'English (US)',
'es_AR' => 'Spanish (Argentine)',
'es_ES' => 'Spanish',
'fi_FI' => 'Finnish',
'fr_FR' => 'Français',
'id_ID' => 'Indonesian',
'it_IT' => 'Italian',
'ja_JP' => 'Japanese',
'ko_KR' => 'Korean',
'nl_NL' => 'Dutch',
'pl_PL' => 'Polski',
'pt_BR' => 'Portuguese (Brazil)',
'ru_RU' => 'Russian',
'zh_CN' => 'Chinese Simplified'
);

/**
* Format of date - see strftime() in PHP manual
* NOTE: setting according local is done in testlinkInitPage() using set_dt_formats()
*/

/** Default format of date */
$g_date_format ="%d/%m/%Y";
$g_timestamp_format = "%d/%m/%Y %H:%M:%S";

/** localized format of date */
$g_locales_date_format = array(
'cs_CZ' => "%d.%m.%Y",
'de_DE' => "%d.%m.%Y",
'en_GB' => "%d/%m/%Y",
'en_US' => "%m/%d/%Y",
'es_AR' => "%d/%m/%Y",
'es_ES' => "%d/%m/%Y",
'fi_FI' => '%d/%m/%Y',
'fr_FR' => "%d/%m/%Y",
'id_ID' => "%d/%m/%Y",
'it_IT' => "%d/%m/%Y",
'ja_JP' => "%Y/%m/%d",
'ko_KR' => '%Y/%m/%d',
'nl_NL' => "%d-%m-%Y",
'pl_PL' => "%d.%m.%Y",
'pt_BR' => "%d/%m/%Y",
'ru_RU' => "%d/%m/%Y",
'zh_CN' => "%Y-%m-%d"
);

/** localized format of full timestamp */
$g_locales_timestamp_format = array(
'cs_CZ' => "%d.%m.%Y %H:%M:%S",
'de_DE' => "%d.%m.%Y %H:%M:%S",
'en_GB' => "%d/%m/%Y %H:%M:%S",
'en_US' => "%m/%d/%Y %H:%M:%S",
'es_AR' => "%d/%m/%Y %H:%M:%S",
'es_ES' => "%d/%m/%Y %H:%M:%S",
'fi_FI' => '%d/%m/%Y %H:%M:%S',
'fr_FR' => "%d/%m/%Y %H:%M:%S",
'id_ID' => "%d/%m/%Y %H:%M:%S",
'it_IT' => "%d/%m/%Y %H:%M:%S",
'ja_JP' => "%Y/%m/%d %H:%M:%S",
'ko_KR' => '%Y/%m/%d %H:%M:%S',
'nl_NL' => "%d-%m-%Y %H.%M:%S",
'pl_PL' => "%d.%m.%Y %H:%M:%S",
'pt_BR' => "%d/%m/%Y %H:%M:%S",
'ru_RU' => "%d/%m/%Y %H:%M:%S",
'zh_CN' => "%Y-%m-%d %H:%M:%S"
);

/** localized date format for smarty templates (html_select_date function) */
$g_locales_html_select_date_field_order = array(
'cs_CZ' => "dmY",
'de_DE' => "dmY",
'en_GB' => "dmY",
'en_US' => "mdY",
'es_AR' => "dmY",
'es_ES' => "dmY",
'fi_FI' => 'dmY',
'fr_FR' => "dmY",
'id_ID' => "dmY",
'it_IT' => "dmY",
'ja_JP' => "Ymd",
'ko_KR' => 'Ymd',
'nl_NL' => "dmY",
'pl_PL' => "dmY",
'pt_BR' => "dmY",
'ru_RU' => "dmY",
'zh_CN' => "Ymd"
);
Unhandled
Advanced user
Posts: 67
Joined: Sun Jan 23, 2011 11:28 pm

Re: how to localize the timezone?

Post by Unhandled »

Timezone is picked up by PHP configuration. See this post:
http://www.teamst.org/forum/viewtopic.php?f=5&t=733
Matt
Advanced user
Posts: 19
Joined: Thu Jun 24, 2010 10:49 am

Re: how to localize the timezone?

Post by Matt »

That post goes to a 1.7 forum, which is now shut as 1.7 is no longer supported. Also, following the steps set out there I did not solve my timestamping issue.

Any ideas whether anything changed in 1.9 releases re timestamping? Running out of ideas now....
fman
Member of TestLink Community
Posts: 3108
Joined: Tue Nov 15, 2005 7:19 am

Re: how to localize the timezone?

Post by fman »

As stated time zone is defined in php.ini
after doing change you need to restart webserver
Of course this will have no effect on all OLD data, but will act on new write to db
Post Reply