axioma Posted April 1, 2010 Share Posted April 1, 2010 Your store is located on London UK, but your web store is hosted on California USA, the orders and whois shows only the time of your hosting server California, BUT not the time of your store in London. THE IDEA IS ONLY CHANGE THE TIMESTAMP IN YOUR SERVER INSTEAD CHANGE A LOT OF FILES IN YOUR ESTORE Please backup first. This configuration works on my hosting on Bluehost, try if this works for your server also... I HOPE SO. Get your php.ini Add inside date.timezone = "Europe/London"; depending your time zone, Use the appropriate option at http://php.net/timezones Within public_html create a file call it inilocaxx.php (to avoid that somebody guess the name) with the following syntax included within it: <pre><?php system("find . -type d|xargs -i cp --verbose php.ini {}/."); ?></pre>COMPLETE! Upload the file to public_html where you already have the initial php.ini (modified with the timezone) file, you would go to http://www.maindomain.com/ inilocaxx.php This will copy the file to every folder below public_html. Now if you have your store in a subfolder you will want to change the subfolder only; so… upload the file to your storexyz where you already have place the php.ini (modified with the timezone) file, next, you would go to http://www.maindomai...z/inilocaxx.php This will copy the file to every folder below storexyz. Also make this changes to your languages files Ie On catalog/ includes/languages/english.php find @setlocale(LC_TIME, 'en_US.ISO_8859-1'); Change by @setlocale(LC_TIME, 'en_GB'); @PUTENV('TZ=Europe/London'); @mktime('0,0,0,1,1,1970'); Admin/includes/languages/english.php find setlocale(LC_TIME, 'en_US.ISO_8859-1'); Change by setlocale(LC_TIME, 'en_GB'); @PUTENV('TZ=Europe/London'); @mktime('0,0,0,1,1,1970'); I HOPE THAT WORKS FOR YOU TOO. Link to comment Share on other sites More sharing options...
♥geoffreywalton Posted April 1, 2010 Share Posted April 1, 2010 Or you could try the add on http://addons.oscommerce.com/info/5432 or http://addons.oscommerce.com/info/4156 But nice work!! Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile Virus Threat Scanner My Contributions Basic install answers. Click here for Contributions / Add Ons. UK your site. Site Move. Basic design info. For links mentioned in old answers that are no longer here follow this link Useful Threads. If this post was useful, click the Like This button over there ======>>>>>. Link to comment Share on other sites More sharing options...
Winterburn Posted May 23, 2010 Share Posted May 23, 2010 Here is my 2 cents regarding the timezone changing on osCommerce. First, add this on your application_top.php (on all includes) date_default_timezone_set("ASIA/BANGKOK"); Of course, change the contents to your appropriate timezone. This will change the way PHP date functions are displayed. To change the timezone on a mySQL level, I have created this neat trick. I just don't know if it is failsafe or what. On includes/functions/database.php, find the following lines: function tep_db_query($query, $link = 'db_link') { global $$link; .... and add the following below the "global" part: if (strstr($query, 'now()')) { $datestr = date('Y-m-d H:i:s'); $query = str_replace('now()', "'" . $datestr . "'", $query); } ..also, find the "now()"'s and do this: case 'now()': $datestr = date('Y-m-d H:i:s'); $query .= "'" . $datestr . "', "; and this: case 'now()': $datestr = date('Y-m-d H:i:s'); $query .= $columns . "'" . $datestr . "', "; Basically, the code just replaces any occurrence of now() in your tep_db_query function and tep_db_perform function with a date outputted by the function date(). This will align the PHP date with the mySQL date. Link to comment Share on other sites More sharing options...
Yann Posted January 31, 2011 Share Posted January 31, 2011 Here is my 2 cents regarding the timezone changing on osCommerce. First, add this on your application_top.php (on all includes) date_default_timezone_set("ASIA/BANGKOK"); Of course, change the contents to your appropriate timezone. This will change the way PHP date functions are displayed. To change the timezone on a mySQL level, I have created this neat trick. I just don't know if it is failsafe or what. On includes/functions/database.php, find the following lines: function tep_db_query($query, $link = 'db_link') { global $$link; .... and add the following below the "global" part: if (strstr($query, 'now()')) { $datestr = date('Y-m-d H:i:s'); $query = str_replace('now()', "'" . $datestr . "'", $query); } ..also, find the "now()"'s and do this: case 'now()': $datestr = date('Y-m-d H:i:s'); $query .= "'" . $datestr . "', "; and this: case 'now()': $datestr = date('Y-m-d H:i:s'); $query .= $columns . "'" . $datestr . "', "; Basically, the code just replaces any occurrence of now() in your tep_db_query function and tep_db_perform function with a date outputted by the function date(). This will align the PHP date with the mySQL date. Hi, This was working very fine for a while, then I suddenly started to get a 1064 SQL error. I'm not sure where the problem comes from (probably an SQL update) but the SQL error seems to appear only when you update a product (when you insert something in the DB, it's just fine). It just doesn't want to print the "=" after "products_last_modified", which results in the 1064 error. So I just replace this : case 'now()': $datestr = date('Y-m-d H:i:s'); $query .= $columns . "'" . $datestr . "', "; By this : case 'now()': $datestr = date('Y-m-d H:i:s'); $query .= $columns . "='" . $datestr . "', "; Not sure this is correct, but it works for me. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.