Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Eventlog and GMT  (Read 735 times)

0 Members and 1 Guest are viewing this topic.

tomoose

  • Modder
  • member
  • Offline Offline
  • Posts: 1683
  • Iiiiiiiit's ME! Hurrah!!
    • 71 "Eagle" Squadron
Eventlog and GMT
« on: February 16, 2018, 04:41:06 PM »

After all this time I've just noticed something about the eventlog.txt file.
Here's an example of the first couple of lines for a mission:

[15.02.2018 2:10:38] Mission: net/coop/DCG/ETO_USFighter194410240.mis is Playing
14:00:00 Mission BEGIN...

My question is:  the time shown as 2:10:38 appears to be GMT.  I'm basing this on the fact that our coop missions are always flown at 2100hr EST (or shortly thereafter once we sort ourselves out).
The 2:10:38 appears to be five hours ahead hence my guess that it's based on GMT.  Where is the game getting this time info?  Can I change it to my local time?  My computer is obviously already set to local time so I can't understand where the 2:10:38 timing is coming from.

Can anyone explain this and perhaps suggest a "fix"?

thanks,
Tomoose
Logged

western0221

  • Modder
  • member
  • Offline Offline
  • Posts: 6790
  • Live in Japan
    • IL-2 itaki blog
Re: Eventlog and GMT
« Reply #1 on: February 16, 2018, 10:13:55 PM »

General error log is com.maddox.rts. ConsoleLogFile.class , type(String s) method ?
Code: [Select]
    public void type(String s)
    {
        if(Console.bTypeTimeInLogFile)
        {
            Calendar calendar = Calendar.getInstance();
            f.print("[" + shortDate.format(calendar.getTime()) + "]\t");
        }
        f.print(s);
    }

and eventlog.lst is com.maddox.il2.ai. EventLog.class , type(boolean flag, String s) method ?
Code: [Select]
    public static void type(boolean flag, String s)
    {
        if(open())
        {
            if(flag)
            {
                Calendar calendar = Calendar.getInstance();
                file.println("[" + longDate.format(calendar.getTime()) + "] " + s);
            } else
            {
                file.println(s);
            }
            file.flush();
        }
    }

Both use Calendar.getInstance(); method.
Java might use DEFAULT TimeZone for Calendar.getInstance().
Java game system of Il-2 1946 looks never set default TimeZone in text searching about all source.
How about Java VM default of Il-2 1946 running on Windows ?
If never set default TimeZone, GMT might be set.
Logged

SAS~Storebror

  • Editor
  • member
  • Offline Offline
  • Posts: 23601
  • Taking a timeout
    • STFU
Re: Eventlog and GMT
« Reply #2 on: February 17, 2018, 12:06:01 AM »

It's a limitation of the Java VM used by IL-2.
With your "local" Java VM installed on Windows, this won't happen.

There's no way to get the local time in IL-2 without adding a native DLL and querying the local timezone through JNI in this case.
I have once started doing that, but eventually abandoned the project when I figured that it would cause weird results for server operators.
After all, the bottom line is "yes, IL-2 logs are GMT" and once you know it, you can deal with it ;)

Cheers!
Mike
Logged
Don't split your mentality without thinking twice.

tomoose

  • Modder
  • member
  • Offline Offline
  • Posts: 1683
  • Iiiiiiiit's ME! Hurrah!!
    • 71 "Eagle" Squadron
Re: Eventlog and GMT
« Reply #3 on: February 17, 2018, 12:09:01 PM »

Ackd.  Zulu time it is.  Given the international nature of the servers it now makes perfect sense.
The reason seems so obvious now....d'oh.
Thanks.
Logged
Pages: [1]   Go Up
 

Page created in 0.067 seconds with 25 queries.