Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Problem with local time

Hi, I'm not able to set correct time. What am I doing wrong?

OS: TurnKey Linux 13.0 / Debian 7.4 Wheezy, Proxmox OpenVZ CT
osTicket version: v1.8.2-dpr-11-gc754f04
osTicket System Settings and Preferences: GMT 1.0, observe daylight savings
result: 10:03 but it may be 11:03...

# ls -l /etc/localtime
lrwxrwxrwx 1 root root 33 Apr 16 10:52 /etc/localtime -> /usr/share/zoneinfo/Europe/Prague
cat /etc/timezone
Europe/Prague
# echo "system: `date '+%H:%M'`"
system: 11:03
# echo '<?php echo "php: ".date("H:i")."\n";?>'|php
php: 11:03

Tagged:

Comments

  • I'm just not sure what time setting at your command prompt have to do with time settings inside the web application. I'd check your users accounts time zone setting first.

    Staff panel -> My Preferences -> Time Zone:

    And then I would check Admin panel -> Settings -> Default Time Zone:

    And then I would check your php.ini where the time zone could be hard coded.
  • hi @ntozier, thank for you reply.

    Commnad propt commands are for to be sure that my system is running in local time and my system timezone is set. As you can see, the last command is the php script and that is the proof of correct php configuration.

    AFAIK setting default timezone is enough for this and I'd like to set default timezone settings (/scp/settings.php?t=system) instead of user/staf preferences (/scp/profile.php) but in this case, user has been set from default and I checked it twice.  As you can see on my first post, I've already set GMT+1 inc. daylight saving (result may be +2 hours).

    ... and no hardcoded tz in the ini


  • Problem is within the TZ config because regardless of the value selected $config['tz_offset'] is still empty.
    referring to: /include/staff/settings-system.inc.php:132
  • Do you have Daylight Saving: checked?
  • yes, as I said in my 1st and 2nd post, daylight saving is enabled (checked) and $config['enable_daylight_saving'] is 1. I have problem with tz_offset but not with enable_daylight_saving. Thanks
  • edited May 2014
    Check the following:
    1. your PHP.ini for your set time zone.
    2. My Preferences -> Time Zone
    3. Admin panel -> Settings -> Default Time Zone
    4. Admin panel -> Staff -> each staff -> Staff's Time Zone
    1. not set
    ini_get('date.timezone') returns "" 

    2. there is correct time ... image

    3. there is wrong time, it has to be 14:04, but $config['tz_offset'] is empty  regardless of default TZ selection.
    Referring to: /include/staff/settings-system.inc.php:132
    image

    4. same as point 2
  • edited June 2016
    Hi @ntozier, after some time, I've decided to implement osTicket and I found the old issue again.
    edit: osTicket v1.9.14 (8b927a0)

    Staff panel -> My Preferences -> Time Zone ... this is correct, I've my GMT+1+DS TZ and $info['tz_offset'] is returning correct value which is resulting in correct time

    Admin panel > System settings -> TZ GMT+1, DS, but wrong time. Why? Because $config['tz_offset'] is not set at all. Just default_timezone_id

    User page > Profile > TZ GMT+1, DS, wrong time. $info['tz_offset'] is not set, just timezone_id

    My system time is correct, OS, PHP, MySQL timezones are ok. Good thing is that tickets are with correct time but I don't want to answer to questions of customers "Why is wrong time in my profile setting" and unfontunately our customers will ask :(   (same as I've to change the 'Please wait... it will take a second!' string because academicians can hold the stopwatch and complain about this... we know our people)
  • This thread is from May of 2014.
    Are you seriously still running 1.8.2?
  • nope, sorry I didn't mentioned the version ... v1.9.14 (8b927a0)
  • edited June 2016
    So then what is your actual problem since I quite sure that it is not the same as it was.
  • edited June 2016
    Yes, problem is the same. User Profile (/osticket/profile.php) and System Settings (/osticket/scp/settings.php) is showing the wrong time (you may change the TZ as you want but time is still (local-tzOffset)+DS, in my case GMT+DS but I need (local-tzOffset)+tzOffset+DS ... it's $gmtime+null+ds instead of $gmtime+tzoffset+ds).

    Staff Profile (/osticket/scp/profile.php), all staff profiles and ticket time is correct.

    And as I said, problem is in variables which are not set (so returning null):
    /osticket/include/staff/settings-system.inc.php - $config['tz_offset']
    /osticket/include/client/profile.inc.php - $info['tz_offset']


    PS: that part with GMT, local time, etc. is weird, but you probably know the source code ...
    Misc::gmtime() returns time()-date('Z')  ... which converts my local time into the GMT (because od 'Z') so I need to add the TZ offset back and it has to be stored in the tz_offset within $config or $info

  • Well since your so sure of what the problem is perhaps you should report the issue on github.
    https://github.com/osTicket/osTicket/issues/new
  • edited June 2016
    okay then ...

Sign In or Register to comment.