setlocale in gsconfig.php - date is not correct - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: Installation & Setup (http://get-simple.info/forums/forumdisplay.php?fid=5) +--- Thread: setlocale in gsconfig.php - date is not correct (/showthread.php?tid=1000) |
setlocale in gsconfig.php - date is not correct - JP - 2010-09-27 GetSimple does not take settings from the variable setlocale in gsconfig.php (e.g. cs_CZ, Czech) - the date is still written in English. See attachment. What should I do? setlocale in gsconfig.php - date is not correct - yojoe - 2010-09-27 I see that you test it on local webserver. Is your webserver configured correctly to operate with setlocale (does it contain CZ)? Screenie you posted shows date of added page in plain GS, or is it a content posted using an additional plugin ? I'd firstly try to look how does it work on my hosting provider's server. ps. try to use strftime with your own date display setting. setlocale in gsconfig.php - date is not correct - JP - 2010-09-30 yojoe Wrote:I see that you test it on local webserver.Other specific function Czech display is right. yojoe Wrote:Screenie you posted shows date of added page in plain GS, or is it a content posted using an additional plugin ?Both - plain GS (date of entry) and plugin (Calendar - Events). yojoe Wrote:I'd firstly try to look how does it work on my hosting provider's server.Not working - same as the local webserver. yojoe Wrote:ps. try to use strftime with your own date display setting.I do not understand... P.S. maybe the error is in the date_default_timezone_set? setlocale in gsconfig.php - date is not correct - cumbe - 2010-09-30 Hello, the only way I got the correct date was with the plugin: http://get-simple.info/forum/post/4414/#p4414 Only translate the array to you lang. Regards. setlocale in gsconfig.php - date is not correct - yojoe - 2010-10-06 JP Wrote:yojoe Wrote:ps. try to use strftime with your own date display setting.I do not understand... K, I've managed to get it working after lotsa time :\ Set your timezone in GM options (admin panel), and add your timezone to .htaccess (to be sure) Code: SetEnv TZ Europe/Prague Next thing is to change default timezone in admin/inc/common.php line 74 Now the whole trick. I've mentioned about strftime function, as it's used to format the date to specific locale settings. GS uses strtotime function, which is capable of showing date only in US date format. Locate admin/inc/theme_functions.php file, and find function get_page_date Inside change (delete or comment) Code: echo date($i, strtotime($date)); Code: echo iconv("", "UTF-8",strftime('%A, %e.%B. %Y')); That should do it. I prepared the date as you have shown on img included in 1st post. You may also change first line of this function to Code: function get_page_date($i = "l, j.m.Y - H:i") Let me know if it worked. I'll try to report this "bug". |