ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Reliability of time functions (https://www.esoui.com/forums/showthread.php?t=6097)

haggen 02/12/16 03:51 PM

Reliability of time functions
 
Could somebody (preferably Chip himself :P) answer me in detail how the functions below calculate the time, and what timezone they're in.

1. GetTimeStamp
2. GetFormattedTime
3. GetTimeString
4. GetDate
5. GetGameTimeMilliseconds
6. GetFrameTimeMilliseconds
7. GetFrameTimeSeconds
8. GetSecondsSinceMidnight

I'm particularly interested if any of the functions are based on the server's local time instead of the client's.

Thanks in advance!

Ayantir 02/12/16 08:55 PM

Quote:

Originally Posted by haggen (Post 25987)
Could somebody (preferably Chip himself :P) answer me in detail how the functions below calculate the time, and what timezone they're in.

1. GetTimeStamp
2. GetFormattedTime
3. GetTimeString
4. GetDate
5. GetGameTimeMilliseconds
6. GetFrameTimeMilliseconds
7. GetFrameTimeSeconds
8. GetSecondsSinceMidnight

I'm particularly interested if any of the functions are based on the server's local time instead of the client's.

Thanks in advance!

  1. OS local
  2. OS local
  3. OS local
  4. OS local
  5. N/A
  6. N/A
  7. N/A
  8. OS local

votan 02/13/16 02:26 AM

Quote:

Originally Posted by haggen (Post 25987)
1. GetTimeStamp
2. GetFormattedTime
3. GetTimeString
4. GetDate
5. GetGameTimeMilliseconds
6. GetFrameTimeMilliseconds
7. GetFrameTimeSeconds
8. GetSecondsSinceMidnight

In addition to Ayantir's post:
1. Is UTC+0 for everybody, including the server. It is client local, but if synced with Network Time Protocol*, the same time as the server has.
UNIX timestamp: Seconds since 1/1/1971
5. Milliseconds since program started. (Not since character in world)
6/7: Same as 5, but a snapshot for the frame currently rendered. GetGameTimeMilliseconds>=GetFrameTimeMilliseconds. If greather than 16.667ms no more 60fps.
8: Client local seconds of the day, including daylight saving.
Current time shift compared to 1:
Code:

        local localTimeShift = GetSecondsSinceMidnight() -(GetTimeStamp() % 86400)
        if localTimeShift < -12 * 60 * 60 then localTimeShift = localTimeShift + 86400 end

*Cleartext: Your clock is running correct. :)

coolmodi 02/13/16 05:26 AM

Quote:

Originally Posted by votan (Post 25997)
In addition to Ayantir's post:
1. Is UTC+0 for everybody, including the server. It is client local, but if synced with Network Time Protocol*, the same time as the server has.
UNIX timestamp: Seconds since 1/1/1971

*Cleartext: Your clock is running correct. :)

Sadly even with synced time over the web it won't be the same. For Haggen and me it was off by around a minute. Not much, but it's still useless if you want to somehow export data with correct time, like combat logs or whatever.

votan 02/13/16 05:57 AM

Quote:

Originally Posted by coolmodi (Post 25998)
Sadly even with synced time over the web it won't be the same. For Haggen and me it was off by around a minute. Not much, but it's still useless if you want to somehow export data with correct time, like combat logs or whatever.

Well, once you know, that you have to check that:
https://technet.microsoft.com/en-us/...=ws.10%29.aspx:

"Support boundary to configure the Windows Time service for high accuracy environments
We do not guarantee and we do not support the accuracy of the W32Time service between nodes on a network. The W32Time service is not a full-featured NTP solution that meets time-sensitive application needs. The W32Time service is primarily designed to do the following:

Make the Kerberos version 5 authentication protocol work.
Provide loose sync time for client computers.The W32Time service cannot reliably maintain sync time to the range of 1 to 2 seconds. Such tolerances are outside the design specification of the W32Time service."

Kerberos tolerance is about 5min.

If you want to do that, you may need to download a real NTP client.

silentgecko 02/13/16 06:57 AM

thanks all for making things clear here.
i started the discussion about it yesterday in our dev-chat :D

the reason behind this question is that i want to make a combat log export, like wow logs, and for this all timestamps from all players (for e.g. in group) have to be in sync. otherwise you'll have an offset.

i think i have to add a datasync before the fight starts, to get all players in sync :/ i hoped that i don't have to :(

haggen 02/13/16 07:31 AM

Thank you so much Votan and Ayantir for the excellent information and coolmodi and silentgecko for the enlightening discussion. :D


All times are GMT -6. The time now is 07:02 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI