Skript: unix timestamp of now is inconsistent

Created on 1 Oct 2020  路  4Comments  路  Source: SkriptLang/Skript

Description


using "unix timestamp of now" expression returns different results in different servers, I have no idea how. one server returns milliseconds and other server returns seconds

Steps to Reproduce


I sadly do not know how to reproduce this, I do not know why servers return data differently

Expected Behavior


to return unix timestamp in one consistent format, preferably seconds

Errors / Screenshots


server 1 (1.12.2):

executing 'send "%unix timestamp of now%"'
1601551539140

server 2 (1.12.2):

executing 'send "%unix timestamp of now%"'
1601551681.555

server 3 (1.16.3):

executing 'send "%unix timestamp of now%"'
1601551587.539

Server Information

  • Server version/platform: server 1 and 2: 1.12.2 Paper, server 3: 1.16.3 Purpur
  • Skript version: 2.5 all of them

Additional Context


the funny thing is, server 1 and 3 are on the same machine, so it is not machine-dependent.
all 3 servers run on Java 11

server 1, the one having issue is the smallest in terms of content, plugins, etc.

this is pretty critical for me as I depend on unix timestamps in scripts that I share between all servers and it being inconsistent creates a lot of problems

Most helpful comment

Glad you figured it out.

For future notice, as is stated on this repo in regards to posting issue, please test without addons first, to help weed out the issues caused by addons.

All 4 comments

on server 1, any chance you have an addon that has this same expression?

Looking at the code, this literally returns System.currentTimeMillis() / 1000
I cant seen any reason this would be different across 2 similar servers, unless its an addon issue.

on server 1, any chance you have an addon that has this same expression?

Looking at the code, this literally returns System.currentTimeMillis() / 1000
I cant seen any reason this would be different across 2 similar servers, unless its an addon issue.

I do not have skUtilities so that's unlikely... but I'll try removing stuff and see

found the problem, was caused by MorkazSK addon, thanks for the help

Glad you figured it out.

For future notice, as is stated on this repo in regards to posting issue, please test without addons first, to help weed out the issues caused by addons.

Was this page helpful?
0 / 5 - 0 ratings