Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2005
    Posts
    229
    Plugin Contributions
    0

    Default How to show time in dates?

    Hello,

    Long time ago I made a custom functions_email.php. This is great but now I need to show the time in the orders date.

    I found the place where it is, in my line 516 I find :
    zen_date_long($order_check->fields['date_purchased'])

    the result in the mail is "Thursday 25 August, 2011"

    I'd like it to be "Thursday 25 August, 2011, 15:16:17"

    If I go to see date_purchased in phpMyAfmin I see that the time is here in the date_purchased field but I don't know how to get it.

    What do I need to modify to get this in this file and only in this file ?
    Do I need to replace zen_date_long by another function ? If so which one ?
    Do I need to build a custom function so that the time is shown only in this case (if so I really need help) ?


    Thanks for reading and your help.

    Regards

    Hubert

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How to show time in dates

    Customize the format on the define:
    Code:
    /admin/includes/languages/english.php
    
    Line #22 : define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
    to suite your specific needs ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Mar 2005
    Posts
    229
    Plugin Contributions
    0

    Default Re: How to show time in dates?

    Thanks for the answer,

    I've changed
    define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()

    with

    define('DATE_FORMAT_LONG', '%A %d %B, %Y H:i:s'); // this is used for strftime()

    and that doesn't do the trick.

    The output is still : Saturday 27 August, 2011

    Hubert

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How to show time in dates?

    Try this:
    /admin/includes/languages/english.php

    Line #25 : define('DATE_FORMAT_LONG', '%A %d %B, %Y %H:%M:%S'); // this is used for strftime()
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Mar 2005
    Posts
    229
    Plugin Contributions
    0

    Default Re: How to show time in dates?

    Hmmm... That's still not the solution.

    To be complete here is my mod in fuction_email.php
    Code:
    $order_check = $db->Execute("select orders_id, cc_cvv, customers_name, customers_company, customers_street_address,
                                        customers_suburb, customers_city, customers_postcode,
                                        customers_state, customers_country, customers_telephone,
                                        customers_email_address, customers_address_format_id, delivery_name,
                                        delivery_company, delivery_street_address, delivery_suburb,
                                        delivery_city, delivery_postcode, delivery_state, delivery_country,
                                        delivery_address_format_id, billing_name, billing_company,
                                        billing_street_address, billing_suburb, billing_city, billing_postcode,
                                        billing_state, billing_country, billing_address_format_id,
                                        payment_method, cc_type, cc_owner, cc_number, cc_expires, currency,
                                        currency_value, date_purchased, orders_status, last_modified, shipping_method
                                 from " . TABLE_ORDERS . "
                                 where orders_id = '" . (int)$MyoID . "'");
    .
    .
    .
     $Emb_Order_Extra = '<table border="0" cellspacing="0" cellpadding="2"  width="275"><tr><td class="main"><strong>' .  ENTRY_DATE_PURCHASED .  '</strong></td></tr><tr><td class="main">' .  zen_date_long($order_check->fields['date_purchased']) .  '</td></tr><tr><td class="main">' .  '<b>Customer comments: </b><br>' . $orders_history->fields['comments'] .  '</td></tr><tr><td class="main"><b>' .  ENTRY_PAYMENT_METHOD .  '</b></td></tr><tr><td class="main">' .  $order->info['payment_method'] .  '</td></tr></table>';
    As far as I see the function is "zen_date_long($order_check->fields['date_purchased'])"

    I don't understand why the modifications doesn't modify anything, it's as if it wasn't the good english.php file.... ???

    I'm puzzled..

    Thanks again for your help

    Hubert

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How to show time in dates?

    Not sure what to tell you about your custom code in the function ...

    I know that change in the admin english.php will make the orders display with both date and time that you can see when you edit the order ...
    Date Purchased: Monday 29 August, 2011 23:15:07
    Payment Method: Check/Money Order
    You will need to see if you are not modifying the function file correctly ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How to show time in dates?

    NOTE: if your function is for the Catalog, you need to also edit the Catalog english.php file ...
    /includes/languages/english.php
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #8
    Join Date
    Mar 2005
    Posts
    229
    Plugin Contributions
    0

    Default Re: How to show time in dates?

    As far as I only want to modify the format for my mod and nowhere else, can I write something like that in my custom functions_email.php ?

    Code:
    define('DATE_FORMAT_LONG', '%A %d %B, %Y %T');
     $Emb_Order_Extra = '<table border="0" cellspacing="0" cellpadding="2"  width="275"><tr><td class="main"><strong>' .  ENTRY_DATE_PURCHASED .  '</strong></td></tr><tr><td class="main">' .  zen_date_long($order_check->fields['date_purchased']) .  '</td></tr><tr><td class="main">' .  '<b>Customer comments: </b><br>' . $orders_history->fields['comments'] .  '</td></tr><tr><td class="main"><b>' .  ENTRY_PAYMENT_METHOD .  '</b></td></tr><tr><td class="main">' .  $order->info['payment_method'] .  '</td></tr></table>';
    define('DATE_FORMAT_LONG', '%A %d %B, %Y');
    i.e. changing the format temporarly and then redefining it as it was before.

    Hubert

 

 

Similar Threads

  1. v150 Is There A Way To NOT Show Dates On Product Reviews?
    By Scully in forum General Questions
    Replies: 5
    Last Post: 16 Sep 2013, 11:40 PM
  2. how to remove "Specials"? and show quick re-order at the same time when login?
    By stevenjiang613 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 13 Nov 2010, 06:18 PM
  3. SHOW Specials Start and Expirey dates
    By FromTheRiviera in forum General Questions
    Replies: 16
    Last Post: 17 Dec 2009, 04:08 PM

Posting Permissions

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