Cvar CurrentServerTime

Flux

New member
Hi everyone!

I'm hosting a 7D2D Server i am currently stuck with this issue and hope you can help me out.

I try to calculate the "CurrentServerTime" to a readable format.

Any ideas how i can solve this?

My Settings:

  •     DayNightLength: 120 <!-- real time minutes per in game day: 60 minutes -->
  •     DayLightLength: 18  <!-- in game hours the sun shines per day: 18 hours day light per in game day -->


Thanks in advance

 
Last edited by a moderator:
Curious, exactly what it it you are trying to accomplish.  Your settings are for 120 minute days with 18 hours of daylight.  What about that isn't readable?

 
My question from first post was probably not completely understandable.

Sorry for that.

I mean the Dateformat from Parameter "CurrentServerTime".


 
Ex:
I change the Serverconfig in "sdtdserver.xml" to this:


<!-- -->
<property name="DayNightLength" value="60" /> <!-- real time minutes per in game day: 60 minutes -->
<property name="DayLightLength" value="18" /> <!-- in game hours the sun shines per day: 18 hours day light per in game day -->






My Server-Query-Script show me this:

7d2d_CurrentServerTime.png


Ingame: Day 99 (Monday), 15:56

How can i calculate the "CurrentServerTime" to a readable format?

 
Last edited by a moderator:
I'm curious what isn't readable.  Are you not familiar with how a 24-hour clock works?

Ingame: Day 99 (Monday), 15:56

Ingame: Day 99 (Monday), 3:56 p.m.

Same difference. Both are perfectly readable. 

 
1 day have 86400 seconds

CurrentServerTime says: 2367943

so... 2367943 / 86400 = 27,40

but we have day 99 3:56 pm... how calculate the game the ingame time with the CurrentServerTime string?

 
I'm curious what isn't readable.  Are you not familiar with how a 24-hour clock works?
Yes i am  :)

I posted the day and time to possibly find the connection to the "CurrentServerTime"  (2367943) Gameserver-Variable.

I share a picture from gameserver query-script  to show you the "CurrentServerTime" String. (Post #4)

1 day have 86400 seconds

CurrentServerTime says: 2367943

so... 2367943 / 86400 = 27,40

but we have day 99 3:56 pm... how calculate the game the ingame time with the CurrentServerTime string?


Exactly what i wanted to ask.

 
Last edited by a moderator:
Ahh, your previous image didn't come through, so I thought the output you were getting was literally similar to "Day 99, 15:56".

If I had to guess I would think that value is based on ticks, but it could also be the current uptime, and doesn't have anything to do with the day count. Or maybe it's just a String value for the A2S_INFO or A2S_RULES response. https://developer.valvesoftware.com/wiki/Server_queries 

 
Back
Top