Way to get IRL time?

Hi there,
I’m working on an OOC ticket system for my PW module whereby players can submit tickets to have their items customised and I’m trying to improve it with keeping some logs. I would like to timestamp when the ticket was submitted and when it was attended to, but while I can find functions to get the in-game time, I don’t find ones for the system time.

Is it possible to retrieve the system date/time? If so, how?

  • May

For a basic unix timestamp you can do:

int SqlGetUnixEpoch()
{
    sqlquery sql = SqlPrepareQueryObject(GetModule(), "SELECT UNIXEPOCH();");
    return SqlStep(sql) ? SqlGetInt(sql, 0) : 0;
}

If you need different formats, you can look here: Date And Time Functions

1 Like

Thanks! I didn’t think of using the SQL functions but that’d do it.