Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2019
    Location
    Georgia, USA
    Posts
    54
    Plugin Contributions
    0

    Default Is it possible to easily change the current time on my store?

    I am using ZC version 1.56c. There is a time of day where I want to automatically change some information on my site each day. I need to test it without having to wait for that particular time to occur each day. So, my question is, how can I control the time of day that my site is operating on? That would help in testing whether the information is changing as desired.

    I see the server time on the home page of the Admin area, so I assume that is the time my site is operating on, but I do not see a way to set my site time manually.

    Please Advise,
    mrsawyer

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,403
    Plugin Contributions
    87

    Default Re: Is it possible to easily change the current time on my ZenCart store?

    Edit the storefront file /includes/extra_configures/set_time_zone.php to add your timezone:
    Code:
    <?php
    /**
     * @package initSystem
     * @copyright Copyright 2003-2018 Zen Cart Development Team
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: Drbyte Tue Sep 11 15:54:43 2018 -0400 Modified in v1.5.6 $
     */
    /*
     * Set time zone
    */
      // put your timezone here. Refer to http://www.php.net/manual/en/timezones.php
      $TZ = '';  // eg: 'Europe/Oslo'
    
    
    
      /**
       * MAKE NO CHANGES BELOW THIS LINE
       *
       * The following will take the timezone you specified above and apply it in your store.
       * If you didn't specify one, it will try to use the setting from your server's PHP configuration
       */
      if ($TZ == '') {
        $TZ = date_default_timezone_get();
      }
      if ($TZ != '') {
        putenv('TZ=' . $TZ);
        @date_default_timezone_set($TZ);
      }
    If, for instance, you want the time to reflect Georgia, you'd add the highlighted string:
    Code:
    <?php
    /**
     * @package initSystem
     * @copyright Copyright 2003-2018 Zen Cart Development Team
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: Drbyte Tue Sep 11 15:54:43 2018 -0400 Modified in v1.5.6 $
     */
    /*
     * Set time zone
    */
      // put your timezone here. Refer to http://www.php.net/manual/en/timezones.php
      $TZ = 'America/New_York';  // eg: 'Europe/Oslo'
    
    
    
      /**
       * MAKE NO CHANGES BELOW THIS LINE
       *
       * The following will take the timezone you specified above and apply it in your store.
       * If you didn't specify one, it will try to use the setting from your server's PHP configuration
       */
      if ($TZ == '') {
        $TZ = date_default_timezone_get();
      }
      if ($TZ != '') {
        putenv('TZ=' . $TZ);
        @date_default_timezone_set($TZ);
      }
    That link in the comments (https://www.php.net/manual/en/timezones.php) identifies the other timezone constants if Georgia isn't what you want.

  3. #3
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,625
    Plugin Contributions
    123

    Default Re: Is it possible to easily change the current time on my ZenCart store?

    This procedure is documented here:
    https://docs.zen-cart.com/user/new_u...pics/timezone/
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  4. #4
    Join Date
    Oct 2019
    Location
    Georgia, USA
    Posts
    54
    Plugin Contributions
    0

    Default Re: Is it possible to easily change the current time on my ZenCart store?

    Thanks guys! It seems I've overlooked some useful setup info that I should have read. When time permits, I will revisit all of the setup info to see what else I may have missed.

 

 

Similar Threads

  1. Can I change the time on my store?
    By Miff in forum General Questions
    Replies: 1
    Last Post: 9 Sep 2010, 12:03 PM
  2. Replies: 0
    Last Post: 3 Oct 2008, 06:50 AM
  3. Change store time to EST?
    By BEatMaKeR in forum Customization from the Admin
    Replies: 1
    Last Post: 12 Mar 2008, 10:08 PM
  4. How to easily delete store records?
    By Rasyr in forum General Questions
    Replies: 2
    Last Post: 12 Feb 2008, 05:03 PM

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