Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Dynamic Date & Time Code (irregard server)


Guest

Recommended Posts

I would like to appeal to the development team, that to include dynamic date and time code so that the store running on osCommerce can be configured to any time.

 

Eg. The server may be hosted in US, while the main target audience and the owner of the store is in AUS. As such, it would be appropriate if date and time display and recorded in sql tables are using AUS time. By having a configuration setting on the Configuration page in the Admin console, it would be easier for non-programmer background users to easily configure their store's timezone and date format without having to modify code and maybe breaking some in the process of doing so.

 

In short, sort of like our desktop's region settings, whereby you can configure the date and time format, time zone, etc.

 

Thank You.

Link to comment
Share on other sites

why not use a time/date javascript script that sources this info from the users browser/PC. This is a good one for the date;

 

<script language=JavaScript>
<!--
var months=new Array(13);
months[1]="Jan.";
months[2]="Feb.";
months[3]="March";
months[4]="April";
months[5]="May";
months[6]="June";
months[7]="July";
months[8]="Aug.";
months[9]="Sept.";
months[10]="Oct.";
months[11]="Nov.";
months[12]="Dec.";
var time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();
if (year < 2000) 
year = year + 1900;
document.write('<font size="1">  ');
document.write("<left>" + lmonth + " ");
document.write(date + ", " + year + "</left>");
//-->
</script>

Link to comment
Share on other sites

If this is your code;

 

<table width="100%"  border="0" cellspacing="0" cellpadding="2">
<tr> 
<td>date here please</td>
</tr>
</table>

 

and you want this to appear where the text 'date here please' is, then ammend to this;

 

<table width="100%"  border="0" cellspacing="0" cellpadding="2">
<tr> 
<td>
<!--
var months=new Array(13);
months[1]="Jan.";
months[2]="Feb.";
months[3]="March";
months[4]="April";
months[5]="May";
months[6]="June";
months[7]="July";
months[8]="Aug.";
months[9]="Sept.";
months[10]="Oct.";
months[11]="Nov.";
months[12]="Dec.";
var time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();
if (year < 2000) 
year = year + 1900;
document.write('<font size="1">  ');
document.write("<left>" + lmonth + " ");
document.write(date + ", " + year + "</left>");
//-->
</td>
</tr>
</table>

 

This is the code I used to put the date on this site (above left-hand navigation) - http://www.qdosconsulting.com

Link to comment
Share on other sites

  • 2 months later...

Hi,

 

I have to add my agreement with the original author of this thread. Any search of the forums on the keyword "timezone" will show a plethora of Australian users with this issue, not to mention east-versus-west-coasters.

 

The javascript solution mentioned above is only helpful for displaying the time in the store. The real issue here is the date / time stored in the database and showing up in the order reports. For Australians with US-based servers (of which there are MANY), this means order times being out by almost an entire day.

 

Some of the threads suggest replacing the now() & time() SQL calls, but this is also problematic. Each query must first be analysed to see whether it is updating or retrieving the data .... since we want to change the data only on entry or retrieval, but not both.

 

I will add that now() appears in a multitude of files, both within and outside of quotes, so going through and analysing is a horrific task that must be done with each OSC release.

 

I understand that this is a big request, but it really must be considered given the amount of grief it is causing people.

 

That's my 2 cents :)

 

micro

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...