wrong time on invoice

Discussion in 'Plugins/Modules/Addons' started by Franz, Mar 2, 2017.

  1. Franz

    Franz Member

    Hi,
    I'm not a php developer, but with examples I managed to custimaze invoice for my needs.
    I have odd issue:
    for current time i use code:
    Code:
     $vrijeme = date('H:i:s');
    and for local time: 09:42:00 i get 03:38.00

    if i run on CLI
    Code:
    <?php
    $vrijeme = date('H:i:s');
    echo $vrijeme;
    ?>
    
    time is OK.

    I put time zone on php.ini for apache and fpm, but no change.
    Any tips?

    Debian 7, with PHP 5.4.45-0+deb7u6
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Set the timezone in /usr/local/ispconfig/interface/lib/config.inc.php
     
  3. Franz

    Franz Member

    You saved my day, again :)

    This will not be overwritten by ISPconfig upgrade?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    That's update safe.
     
  5. Franz

    Franz Member

    It is not update safe :(
    Code:
    /usr/local/ispconfig/interface/lib/config.inc.local.php
    is update safe...
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    The timezone in that file /usr/local/ispconfig/interface/lib/config.inc.php is update safe according to the code of the ISPConfig updater.
     
  7. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    Change the Timezone in /usr/local/ispconfig/server/lib/config.inc.php, too. The updater reads the TZ from this file.
     
    till likes this.
  8. Jesse Norell

    Jesse Norell Well-Known Member

    FWIW, I just did a 3.1.1p1 -> 3.1.2 update, and found the same as @Franz, config.inc.php changes were overwritten so had to move them to config.inc.local.php.
     
  9. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    Did you change the timezone in server/lib/config.inc.php?
     
  10. Jesse Norell

    Jesse Norell Well-Known Member

    I suspect so, as it is set correctly, and it differs from php.ini, but would have been done a year ago and I don't recall specifically:
    Code:
    # grep '$conf\[.timezone.\]' /usr/local/ispconfig/*/lib/config.inc.php
    /usr/local/ispconfig/interface/lib/config.inc.php:$conf['timezone'] = 'America/Denver';
    /usr/local/ispconfig/server/lib/config.inc.php:$conf['timezone'] = 'America/Denver';
    
    # grep ^date.timezone /etc/php5/*/php.ini
    /etc/php5/apache2/php.ini:date.timezone = MST7MDT
    /etc/php5/cgi/php.ini:date.timezone = MST7MDT
    /etc/php5/cli/php.ini:date.timezone = MST7MDT
    /etc/php5/fpm/php.ini:date.timezone = MST7MDT
    
    What I was looking at which was overwritten is the enabled interface modules; I have disabled the 'help' module more than once in the past, but now and then I find it enabled again, and now I know why. These are my config.inc*.php files after the 3.1.2 update the other day (at 15:55):
    Code:
    # ls -tlr /usr/local/ispconfig/*/lib/config.inc*
    -rwxr-x--- 1 root      root       261 Sep 22 10:33 /usr/local/ispconfig/server/lib/config.inc.local.php
    -rwxr-x--- 1 ispconfig ispconfig  261 Mar  8 09:57 /usr/local/ispconfig/interface/lib/config.inc.local.php
    -rwxr-x--- 1 ispconfig ispconfig 6836 Mar  8 15:55 /usr/local/ispconfig/interface/lib/config.inc.php~
    -rw------- 1 ispconfig ispconfig 6844 Mar  8 15:55 /usr/local/ispconfig/interface/lib/config.inc.php
    -rw------- 1 root      root      6844 Mar  8 15:55 /usr/local/ispconfig/server/lib/config.inc.php
    
    # diff -u /usr/local/ispconfig/interface/lib/config.inc.php~ /usr/local/ispconfig/interface/lib/config.inc.php--- /usr/local/ispconfig/interface/lib/config.inc.php~    2017-03-08 15:55:01.020664892 -0700
    +++ /usr/local/ispconfig/interface/lib/config.inc.php    2017-03-08 15:55:01.020664892 -0700
    @@ -56,7 +56,7 @@
    
    //** Application
    define('ISPC_APP_TITLE', 'ISPConfig');
    -define('ISPC_APP_VERSION', '3.1.1p1');
    +define('ISPC_APP_VERSION', '3.1.2');
    define('DEVSYSTEM', 0);
    
    
    @@ -119,13 +119,13 @@
    $conf['app_title'] = ISPC_APP_TITLE;
    $conf['app_version'] = ISPC_APP_VERSION;
    $conf['app_link'] = 'http://www.ispconfig.org/';
    -$conf['modules_available'] = 'dashboard,admin,mail,sites,monitor,client,dns';
    +$conf['modules_available'] = 'dashboard,admin,mail,sites,monitor,client,dns,help';
    $conf['server_id'] = '1';
    $conf['init_scripts'] = '/etc/init.d';
    
    
    //** Interface
    -$conf['interface_modules_enabled'] = 'dashboard,mail,sites,dns,tools';
    +$conf['interface_modules_enabled'] = 'dashboard,mail,sites,dns,tools,help';
    
    //** Demo mode
    /* The demo mode is an option to restrict certain actions in the interface like
    
     

Share This Page