Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2006
    Posts
    144
    Plugin Contributions
    0

    Default 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?

  2. #2
    Join Date
    Feb 2006
    Location
    Chicago
    Posts
    1,167
    Plugin Contributions
    0

    Default Re: Wrong date and time on order confirmation

    Here it is in
    admin\orders.php

    Code:
          $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!!

  3. #3
    Join Date
    Sep 2006
    Posts
    144
    Plugin Contributions
    0

    Default WRONG DATE in 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. #4
    Join Date
    Jan 2004
    Posts
    58,289
    Blog Entries
    3
    Plugin Contributions
    106

    Default Re: Wrong date and time on order confirmation

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

    The defaults are:
    Code:
      @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!
    Donations always welcome: www.zen-cart.com/donate

    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.

  5. #5
    Join Date
    Sep 2006
    Posts
    144
    Plugin Contributions
    0

    Default 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.

  6. #6
    Join Date
    Jan 2004
    Posts
    58,289
    Blog Entries
    3
    Plugin Contributions
    106

    Default Re: Wrong date and time on order confirmation

    The email is using this to generate the date in the email:
    Code:
    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!
    Donations always welcome: www.zen-cart.com/donate

    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.

  7. #7
    Join Date
    Jan 2004
    Posts
    58,289
    Blog Entries
    3
    Plugin Contributions
    106

    Default Re: Wrong date and time on order confirmation

    I suppose you could try changing these:
    Code:
    strftime(DATE_FORMAT_LONG)
    to this:
    Code:
    zen_date_long(date("Y-m-d"))
    in both locations near the bottom of the /includes/classes/order.php file (NOT the admin file).
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    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.

  8. #8
    Join Date
    Mar 2009
    Posts
    10
    Plugin Contributions
    0

    Default 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

 

 

Similar Threads

  1. gift certificate - referenced to wrong order
    By heavenlynights in forum Creating Discounts/Coupons, Gift Certificates, Newsletters
    Replies: 6
    Last Post: 21 Sep 2006, 03:47 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •