Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

how to change the date/time in oscommerce?


tomliuwhite

Recommended Posts

I think the dates and times in oscommerce is the same as server time. Our server time is EDT time. But i want to use CDT times in oscommerce and i do not want to change server time. Is there a way that i can change the time function in oscommerce to CDT time?

Many thanks in advance.

Link to comment
Share on other sites

I think the dates and times in oscommerce is the same as server time. Our server time is EDT time. But i want to use CDT times in oscommerce and i do not want to change server time. Is there a way that i can change the time function in oscommerce to CDT time?

Many thanks in advance.

Or is there such kind of contribution which allow me to change the time in oscommerce?

Link to comment
Share on other sites

so if you do not want to touch the locale you could use the strftime or localtime functions and offset the current time by a number of hours and then display it.

Link to comment
Share on other sites

so if you do not want to touch the locale you could use the strftime or localtime functions and offset the current time by a number of hours and then display it.

Thanks for your help. But could you tell me how to do it step by step?

Link to comment
Share on other sites

  • 3 weeks later...
  • 7 months later...

Hi Mark

 

I read this http://www.php.net/manual/en/function.strftime.php

 

but the thing is i have no idea in which page i can find strftime or localtime functions. I have a supertracker contribution. There is a page supertracker.php that shows time. But it shows European time, but i live in Canada so id like to see there Canadian time that means EST. I checked that page and also general.php but i can't find any strftime or localtime functions in there. So where can i find it please?

Link to comment
Share on other sites

Not sure if the script gets the results like GMT or some other method. Before starting goto your osc admin->tools->Server Info. Check at the beginning the date/time. This info should be relative to the server where your store is located. Is that est? or some european time?

Link to comment
Share on other sites

This info should be relative to the server where your store is located. Is that est? or some european time?

 

Thank you very much for replay,Mark

 

The server for my store is located in Europe GMT +1 So osc admin->tools->Server Info shows that time GMT +1.(thanks for the advice) My hosting company is from there. They are really good and cheap.

 

Is there any way how to change the server time to Canada EST time please?

Link to comment
Share on other sites

don't know if the server provides some way for each account to do this. For the osc functions like the strtotime(), time() for instance have to be adjusted to take into account the time offset from server either directly based on the server timezone or using GMT which is better. The supertracker uses this type of functions. So you need to replace them with something like gmmktime() that returns the GMT and then offset it for your timezone.

Link to comment
Share on other sites

don't know if the server provides some way for each account to do this. For the osc functions like the strtotime(), time() for instance have to be adjusted to take into account the time offset from server either directly based on the server timezone or using GMT which is better. The supertracker uses this type of functions. So you need to replace them with something like gmmktime() that returns the GMT and then offset it for your timezone.

I was looking for functions strtotime(), time() in supertracker.php and general.php. But I didn't find any. I found this code though:

 

// Retreive server information
 function tep_get_system_information() {
global $HTTP_SERVER_VARS;

$db_query = tep_db_query("select now() as datetime");
$db = tep_db_fetch_array($db_query);

list($system, $host, $kernel) = preg_split('/[\s,]+/', @exec('uname -a'), 5);

return array('date' => tep_datetime_short(date('Y-m-d H:i:s')),
			 'system' => $system,

 

Does this code needs to be modified?

 

thanks

Link to comment
Share on other sites

try

 

	return array('date' => tep_datetime_short(date('Y-m-d H:i:s', time()-10800 )),
			 'system' => $system,

 

should shift it back 3 hours. It's still based on server local time though.

Link to comment
Share on other sites

Thank you very much for replay,

 

In /icludes/functions/general.php i have changed this

return array('date' => tep_datetime_short(date('Y-m-d H:i:s')),

to this

return array('date' => tep_datetime_short(date('Y-m-d H:i:s', time()-10800 )),

but in supertrcker.php i didn't notice any change in date.

 

So i put on my site in left bottom corner this code modified the way you said and it works there

<?php

/**
* Just add this in your page where you
* want the date/time to appear
*
* For more configuration options look
* in the PHP manual at http://uk2.php.net/date
*/

// Displays in the format Saturday, November 22, 2003 11.38
echo date("l, F d, Y h:i" ,time()-10800 );

?>

 

 

Probably i have to do changes also somewhere else.

I found this code in supertucker.php

 

$keyword_query = "select * from supertracker where DATE_ADD(time_arrived, INTERVAL 7 DAY) >= now() ";

 

Does this code needs to be modified, please?

 

thanks

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...