summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-02-14 16:55:16 -0300
committerJesusaves <cpntb1@ymail.com>2021-02-14 16:55:16 -0300
commit6c9c6b50925b441f09a90eabe1dcfecfe7ee7408 (patch)
treef69e431a37446de25776070e41d4abb424b2d013 /npc/functions
parentc733872ea010e47facfec2b915acd0873a611bf9 (diff)
downloadserverdata-6c9c6b50925b441f09a90eabe1dcfecfe7ee7408.tar.gz
serverdata-6c9c6b50925b441f09a90eabe1dcfecfe7ee7408.tar.bz2
serverdata-6c9c6b50925b441f09a90eabe1dcfecfe7ee7408.tar.xz
serverdata-6c9c6b50925b441f09a90eabe1dcfecfe7ee7408.zip
Add sqldate() function
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/util.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index 2cf7893da..721789f78 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -1144,6 +1144,12 @@ function script numdate {
return atoi(.@strdate$);
}
+// Same as numdate() but SQL format
+function script sqldate {
+ .@strdate$=sprintf("%04d-%02d-%02d %02d:%02d:%02d", gettime(GETTIME_YEAR), gettime(GETTIME_MONTH), gettime(GETTIME_DAYOFMONTH), gettime(GETTIME_HOUR), gettime(GETTIME_MINUTE), gettime(GETTIME_SECOND));
+ return .@strdate$;
+}
+
// json_encode( {varname, varvalue}, {varname 2, varvalue 2}... )
// returns string
function script json_encode {