server timestamp

Hi again,

Do you know how I can check local server time?

I need to track time passed to renew a token, not related to the users module.

The SQL timestamp seem to be reserved for SQL use 

In pure PHP this is simple

\<?php echo time(); ?\>

Yeah but core server side is in lua and i cant use the lua api.

I suppose there is a SQL way, will look into that, but would be a simple yet nice feature of coronium core since much of what we do need access to time.

using the sql api i was unsuccessful in doing a “SELECT NOW()”

local timestamp=core.mysql.localDate() gives me a “Method not implemented” but i suspect it is supposed to work

nevermind, got it to work. the rror message had nothing to do with the timestamp code even though it only triggered when I used it.

a consequencial error of sorts.

debugging on serverside is not easy :slight_smile:

on the bright side, dev has pretty much all basic needs covered.

Hi,

Just a note, you can use the Lua api server-side.

local unixTime = os.time()

Use os.date to format it however you need.

-dev

Yeah i figured that out but was too embarrased to post it  :rolleyes:

I just assumed it was part of the corona API and not core lua.

Sorry about that.

Hi,

Coronium Core uses the latest release of LuaJIT, so it is compatible with Lua 5.1 code stylings.

-dev

In pure PHP this is simple

\<?php echo time(); ?\>

Yeah but core server side is in lua and i cant use the lua api.

I suppose there is a SQL way, will look into that, but would be a simple yet nice feature of coronium core since much of what we do need access to time.

using the sql api i was unsuccessful in doing a “SELECT NOW()”

local timestamp=core.mysql.localDate() gives me a “Method not implemented” but i suspect it is supposed to work

nevermind, got it to work. the rror message had nothing to do with the timestamp code even though it only triggered when I used it.

a consequencial error of sorts.

debugging on serverside is not easy :slight_smile:

on the bright side, dev has pretty much all basic needs covered.

Hi,

Just a note, you can use the Lua api server-side.

local unixTime = os.time()

Use os.date to format it however you need.

-dev

Yeah i figured that out but was too embarrased to post it  :rolleyes:

I just assumed it was part of the corona API and not core lua.

Sorry about that.

Hi,

Coronium Core uses the latest release of LuaJIT, so it is compatible with Lua 5.1 code stylings.

-dev