Implement the get_time() function

This commit is contained in:
Gunnar Beutner 2015-02-24 09:08:31 +01:00
parent 7504f3a3dc
commit 5ceb64d649
2 changed files with 2 additions and 0 deletions

View File

@ -17,6 +17,7 @@ random() | Returns a random value between 0 and RAND_MAX
log(value) | Writes a message to the log. Non-string values are converted to a JSON string.
log(severity, facility, value) | Writes a message to the log. `severity` can be one of `LogDebug`, `LogNotice`, `LogInformation`, `LogWarning`, and `LogCritical`. Non-string values are converted to a JSON string.
typeof(value) | Returns the type object for a value.
get_time() | Returns the current UNIX timestamp.
exit(integer) | Terminates the application.
## <a id="object-accessor-functions"></a> Object Accessor Functions

View File

@ -51,6 +51,7 @@ REGISTER_SCRIPTFUNCTION(assert, &ScriptUtils::Assert);
REGISTER_SCRIPTFUNCTION(string, &ScriptUtils::CastString);
REGISTER_SCRIPTFUNCTION(number, &ScriptUtils::CastNumber);
REGISTER_SCRIPTFUNCTION(bool, &ScriptUtils::CastBool);
REGISTER_SCRIPTFUNCTION(get_time, &Utility::GetTime);
String ScriptUtils::CastString(const Value& value)
{