Wrong Time zone

  • Arakattack

    Arakattack - 2007-09-19

    I have installed mysar and working well. The problem is only the report generated in wrong time zone.
    Example output Details for a Specific Host, User, Date and Site is like this:
    23:24:21      0.28K      http://www.dyndns.org      TCP_MISS/200
    it should be
    15:24:21      0.28K      http://www.dyndns.org      TCP_MISS/200
    To proof it, then i generate report from SARG for comparison. The result is like this:
    www.dyndns.org            09/12/2007            15:24:21

    How to fix this problem? My machine time zone is GMT+8.

    • Ioannis Stoilis

      Ioannis Stoilis - 2007-09-19

      The current version of mysar doesn't support timezone correction.

      You need to either change the local time of the computer running squid or reconfigure squid to log using a corrected timezone and not GMT.

      • Arakattack

        Arakattack - 2007-09-20

        Sorry Giannis, Having learned your code, i decide to remove $timezone_diff and it works for me. I was wrong giving opinion re UTC/GMT problem.

        //while (($timezone_diff = (gmmktime() - mktime()))%10);


        Thank you, now calculation between mysar and netams ip accounting are match.

        • Ioannis Stoilis

          Ioannis Stoilis - 2007-09-20

          Hmm, that line was an addition from a different user. I'll keep an option to enable or disable per choice.

    • Arakattack

      Arakattack - 2007-09-20

      I'm using squid-2.5.STABLE6-3 it seems doesn't support logformat localtime, can we manipulate mktime() in php to have correct localtime?


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks