Returns amount of seconds left for the next server save.
09:55 Server is saving game in 5 minutes.
Please come back later.
And what is sstime showing:
09:56:40 83000 --its from console
Am I missing something or it not work?
Printable View
Returns amount of seconds left for the next server save.
09:55 Server is saving game in 5 minutes.
Please come back later.
And what is sstime showing:
09:56:40 83000 --its from console
Am I missing something or it not work?
Is your computer's clock correct?
Ye im sure, it worked few days ago, i didnt change anything. Now it shows that ss will be at 9:00 o'clock instead of 10:00 if im counting well.
http://i.imgur.com/Hiiwdn6.png
Isn't it easier this way?
function sstiem()
if os.date("%X") >= "09:30" and os.date("%X") <= "10:10" then
return true
else
return false
end
end
function relogtiem()
if os.date("%X") >= "10:30" and os.date("%X") <= "11:00" then
return true
else
return false
end
end
Can you please run the following code? Post the printed values and please also inform your location (Country/City) and timezone.
print('os.date(\'*t\')')
print(os.date('*t'))
print('os.date(\'!*t\')')
print(os.date('!*t'))
print('os.date(\'!%X\')')
print(os.date('!%X'))
print('os.date(\'%X\')')
print(os.date('%X'))
print('utcoffset()')
print(utcoffset())
print('cetoffset()')
print(cetoffset())
print('utctime()')
print(utctime())
print('cettime()')
print(cettime())
print('sstime()')
print(sstime())
Poland,(UTC+01:00) Sarajewo, Skopie, Warsaw, Zagrzeb
http://i.imgur.com/7AmOKsI.png
@Raphael
Try with this version:
I replaced files and reload libraries and still same, there was a typo btw
http://i.imgur.com/FqKR789.png
Try again with this one: (please recopy the printing script, as I've changed a few things on it)
Okay, @pedegie, try this:
print('os.date(\'*t\')')
print(os.date('*t'))
print('os.date(\'!*t\')')
print(os.date('!*t'))
print('os.date(\'!%X\')')
print(os.date('!%X'))
print('os.date(\'%X\')')
print(os.date('%X'))
I feel you are close :D
http://i.imgur.com/wdIoz6n.png
Okie, try this one:
http://i.imgur.com/txcPgyw.png
Now it shows ss at 11:00 - 12:00 o'clock, im not sure :P
@pedegie Try it now. Hehe.
@Raphael Works fine now! :D Should i pic screens here or you dont need it?
Okay thanks a lot! :)
@Raphael For some reason sstime() is returning the wrong time for me, could you help me?
Attachment 11061
Timezone is set to UTC+1. (VPS)
Can I assume you posted right after taking the screenshot? Like, very few minutes later?
Also, are you absolutely sure it's not on UTC+2? Or on a timezone with Daylight Saving Time? Because the data shows the local time (os.date('*t')) as 2h later than UTC time (os.date('!*t')).
Yes, I posted it just after taking the SS.
It is on Daylight Saving Time.
Attachment 11064
11:33:37 os.date('*t')
11:33:37 {sec = 37, min = 33, day = 7, isdst = true, wday = 7, yday = 128, year = 2016, month = 5, hour = 11}
11:33:37 os.date('!*t')
11:33:37 {sec = 37, min = 33, day = 7, isdst = false, wday = 7, yday = 128, year = 2016, month = 5, hour = 9}
11:33:37 os.date('!%X')
11:33:37 09:33:37
11:33:37 os.date('%X')
11:33:37 11:33:37
11:33:37 utcoffset()
11:33:37 -3600
11:33:37 cetoffset()
11:33:37 3600
11:33:37 utctime()
11:33:37 34417
11:33:37 cettime()
11:33:37 34417
11:33:37 sstime()
11:33:37 1583
12:00:22 os.date('*t')
12:00:22 {sec = 22, min = 0, day = 7, isdst = true, wday = 7, yday = 128, year = 2016, month = 5, hour = 12}
12:00:22 os.date('!*t')
12:00:22 {sec = 22, min = 0, day = 7, isdst = false, wday = 7, yday = 128, year = 2016, month = 5, hour = 10}
12:00:22 os.date('!%X')
12:00:22 10:00:22
12:00:22 os.date('%X')
12:00:22 12:00:22
12:00:22 utcoffset()
12:00:22 -3600
12:00:22 cetoffset()
12:00:22 3600
12:00:22 utctime()
12:00:22 36022
12:00:22 cettime()
12:00:22 36022
12:00:22 sstime()
12:00:22 86378
UTC +1
I had to change my sstime function to make it work:
function sstime()
return (36000 - cettime() - 7200) % 86400
end
I'm sorry guys, I haven't had the time to check this out. I'll try and get this done tomorrow or the day after that.
https://i.imgur.com/HTmixid.jpgQuote:
fixed sstime() once again.