Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2005
    Posts
    150
    Plugin Contributions
    0

    Default Show todays date

    I want to have a daily special headed with todays date.

    Now the specials box has this line;

    define('TABLE_HEADING_SPECIALS_INDEX', 'Daily Special For %s');

    It displays as "Daily Special For January"

    I want it to be "Daily special for (todays date)"

    What do I need to change "%s" to to show todays date?

    thanks.

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Show todays date

    You leave this as is but edit this file & line /includes/modules/specials_index.php Find this Line:
    Code:
    $title = '<h2 class="centerBoxHeading">' . sprintf(TABLE_HEADING_SPECIALS_INDEX, strftime('%B')) . '</h2>';
    Assuming you want month/day/year change to:
    Code:
    $title = '<h2 class="centerBoxHeading">' . sprintf(TABLE_HEADING_SPECIALS_INDEX, strftime(
    '%m/%d/%Y')) . '</h2>';
    This should get you the month day and year...you can leave out what you do not want and/or add others like the hour /min/sec
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Show todays date

    NEWS FLASH!!! Alternatively:
    Code:
    define('TABLE_HEADING_SPECIALS_INDEX', 'Daily Special For' . date('D M d Y));
    Zen-Venom Get Bitten

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Show todays date

    CORRECTION:
    Code:
    define('TABLE_HEADING_SPECIALS_INDEX', 'Daily Special For' . date('D M d Y'));
    Credit to "Ajeh"
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Apr 2005
    Posts
    150
    Plugin Contributions
    0

    Default Re: Show todays date

    Quote Originally Posted by kobra View Post
    You leave this as is but edit this file & line /includes/modules/specials_index.php Find this Line:
    Code:
    $title = '<h2 class="centerBoxHeading">' . sprintf(TABLE_HEADING_SPECIALS_INDEX, strftime('%B')) . '</h2>';
    Assuming you want month/day/year change to:
    Code:
    $title = '<h2 class="centerBoxHeading">' . sprintf(TABLE_HEADING_SPECIALS_INDEX, strftime(
    '%m/%d/%Y')) . '</h2>';
    This should get you the month day and year...you can leave out what you do not want and/or add others like the hour /min/sec

    Thanks, that got the date displayed.
    It displays the date as 01/10/07.
    How can I change it to Jan/10/2007 or better yet January 10, 2007?
    I tried changeing %m to %M but that did not work.

  6. #6
    Join Date
    Apr 2005
    Posts
    150
    Plugin Contributions
    0

    Default Re: Show todays date

    OK, the second line worked the best, but both worked.
    In case someone else has the same question I used this line in english.php

    define('TABLE_HEADING_SPECIALS_INDEX', 'Daily Special for ' . date('F d, Y'));

    It displays the date as January 10, 2007.

    Thanks Kobra and Ajeh!

 

 

Similar Threads

  1. Easy Populate and the Date added updated to todays date issue.
    By cyphercys in forum All Other Contributions/Addons
    Replies: 5
    Last Post: 9 Mar 2010, 04:26 AM
  2. Show Date Added?
    By krazykev in forum Basic Configuration
    Replies: 15
    Last Post: 18 Feb 2009, 09:39 AM
  3. Account Created date showing as todays date
    By PatF in forum Managing Customers and Orders
    Replies: 10
    Last Post: 20 Nov 2008, 03:04 PM
  4. Product - show date available
    By icemanchai in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 23 Aug 2006, 10:49 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR