Forums / General Questions / Wrong date and time on order confirmation

Wrong date and time on order confirmation

Locked

Views: 4,563

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
30 Sep 2006, 3:27 PM
#1
paperthreads avatar

paperthreads

Zen Follower

Join Date:
Sep 2006
Posts:
142
Plugin Contributions:
0

Wrong date and time on order confirmation

I'm getting the customer orders sent to me via email, and the date on the order is

Order Number: 53
Date Ordered: Wednesday 31 December, 1969

The time stamp in the admin screen is correct though....so where is the problem so I can fix it?

1 Oct 2006, 5:35 PM
#2
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: Wrong date and time on order confirmation

Here it is in
admin\orders.php

      $html_msg['EMAIL_CUSTOMERS_NAME']    = $check_status->fields['customers_name'];
      $html_msg['EMAIL_TEXT_ORDER_NUMBER'] = EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID;
      $html_msg['EMAIL_TEXT_INVOICE_URL']  = '<a href="' . zen_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') .'">'.str_replace(':','',EMAIL_TEXT_INVOICE_URL).'</a>';
      $html_msg['EMAIL_TEXT_DATE_ORDERED'] = EMAIL_TEXT_DATE_ORDERED . ' ' . zen_date_long($check_status->fields['date_purchased']);
      $html_msg['EMAIL_TEXT_STATUS_COMMENTS'] = nl2br($notify_comments);
      $html_msg['EMAIL_TEXT_STATUS_UPDATED'] = str_replace('\n','', EMAIL_TEXT_STATUS_UPDATED);
      $html_msg['EMAIL_TEXT_STATUS_LABEL'] = str_replace('\n','', sprintf(EMAIL_TEXT_STATUS_LABEL, $orders_status_array[$status] ));

Tutorials on Zen Cart
http://tutorials.zen-cart.com/index.php

advanced.programmer at gmail dot com
In love with Zen Cart!!

4 Oct 2006, 4:40 AM
#3
paperthreads avatar

paperthreads

Zen Follower

Join Date:
Sep 2006
Posts:
142
Plugin Contributions:
0

Re: Wrong date and time on order confirmation

PLEASE HELP! I don't know how to fix this!

**HERE IS MY ZEN CART INFO:
**Server OS: Linux 2.4.21-27.ELsmp
Database: MySQL 4.0.27-max-log
Server Date: 10/03/2006 21:35:42
Database Date: 10/03/2006 21:35:42
Server Up Time: 21:35:42 up 186 days, 22:54, 0 users, load average: 3.05, 4.08, 4.42
PHP Version: 4.3.11
Zen Cart 1.3.0.2
Database Patch Level: 1.3.0.2
HTTP Server: Apache

**Ok, that out of the way, here is my problem! All of my order confirmations are being **sent out with the ORDER DATE of DECEMBER 31, 1969

Although, at the bottom of that order confirmation in the ADMIN section, it gives the proper date and time the order was populated.

How do I FIX the ORDER DATE??? I get emails from my customers telling me my dates are way off... :)

4 Oct 2006, 4:55 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Wrong date and time on order confirmation

What are your date settings in your english.php file?

The defaults are:```
@setlocale(LC_TIME, 'en_US.ISO_8859-1');
define('DATE_FORMAT_SHORT', '%m/%d/%Y'); // this is used for strftime()
define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
define('DATE_FORMAT', 'm/d/Y'); // this is used for date()
define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');

////
// Return date in raw format
// $date should be in format mm/dd/yyyy
// raw date is in format YYYYMMDD, or DDMMYYYY
if (!function_exists('zen_date_raw')) {
function zen_date_raw($date, $reverse = false) {
if ($reverse) {
return substr($date, 3, 2) . substr($date, 0, 2) . substr($date, 6, 4);
} else {
return substr($date, 6, 4) . substr($date, 0, 2) . substr($date, 3, 2);
}
}
}

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

4 Oct 2006, 5:02 AM
#5
paperthreads avatar

paperthreads

Zen Follower

Join Date:
Sep 2006
Posts:
142
Plugin Contributions:
0

Re: Wrong date and time on order confirmation

Thanks, I knew I had posted this, but couldn't find it today, and the last reponse didn't fix the problem! :)

Ok, here is what my code is:

setlocale(LC_TIME, 'en_US.ISO_8859-1');
define('DATE_FORMAT_SHORT', '%m/%d/%Y'); // this is used for strftime()
define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
define('DATE_FORMAT', 'm/d/Y'); // this is used for date()
define('PHP_DATE_TIME_FORMAT', 'm/d/Y H:i:s'); // this is used for date()
define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
define('DATE_FORMAT_SPIFFYCAL', 'MM/dd/yyyy'); //Use only 'dd', 'MM' and 'yyyy' here in any order

////
// Return date in raw format
// $date should be in format mm/dd/yyyy
// raw date is in format YYYYMMDD, or DDMMYYYY
function zen_date_raw($date, $reverse = false) {
if ($reverse) {
return substr($date, 3, 2) . substr($date, 0, 2) . substr($date, 6, 4);
} else {
return substr($date, 6, 4) . substr($date, 0, 2) . substr($date, 3, 2);
}
}

So, mine isn't matching the default, but I'm wondering if this is because we had to upload a mod, because the server time was off about 8 hours, and we needed to get it adjusted to my time zone.....I'm pretty clueless with this stuff, I have someone that helps me, and they are pretty familiar with coding, but they haven't been able to find the problem either.

4 Oct 2006, 6:56 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Wrong date and time on order confirmation

The email is using this to generate the date in the email:```
strftime(DATE_FORMAT_LONG)


strftime() uses the setlocale() settings in effect on your server.

When PHP uses Dec 31/1969 as a displayed date, it means that it was asked to display date information that is smaller than the Linux epoch date of 01/01/1970.

There's nothing obvious to me in what you've posted above in terms of what's causing it.

I suspect you're not very interested in finding and undoing all the time-adjustment settings you've made in your code ... but you may have to.  I don't see anything here that shows an easy adjustment to make in Zen Cart to fix that.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

4 Oct 2006, 6:58 AM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Wrong date and time on order confirmation

I suppose you could try changing these:strftime(DATE_FORMAT_LONG)to this:```
zen_date_long(date("Y-m-d"))

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

3 Dec 2010, 1:04 AM
#8
jgatliff avatar

jgatliff

New Zenner

Join Date:
Mar 2009
Posts:
10
Plugin Contributions:
0

Re: Wrong date and time on order confirmation

I am having the same problem and it only recently happened when I installed a mod and renamed my admin directory.

It sends the right date if someone uses the form to contact us but the wrong date for orders.

Any help would be appreciated.
Jason