summaryrefslogtreecommitdiff
path: root/src/script/api/script_date.cpp
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-12-19 20:59:12 +0000
committertruebrain <truebrain@openttd.org>2011-12-19 20:59:12 +0000
commitc7c1deaf41a2ce8cfa30ea2eaf1ef808e6529eae (patch)
tree16f4e7513ad2f3e67332cb15c40ecbe0614d29c1 /src/script/api/script_date.cpp
parent55de5d336c2b82aa2393a28e09b64f72f4661a25 (diff)
downloadopenttd-c7c1deaf41a2ce8cfa30ea2eaf1ef808e6529eae.tar.xz
(svn r23619) -Add: ScriptDate::GetSystemTime, to get the seconds since 1 Jan 1970 of the real system (GameScript only)
Diffstat (limited to 'src/script/api/script_date.cpp')
-rw-r--r--src/script/api/script_date.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/script/api/script_date.cpp b/src/script/api/script_date.cpp
index 3f3d16bcc..1f80b40d7 100644
--- a/src/script/api/script_date.cpp
+++ b/src/script/api/script_date.cpp
@@ -9,6 +9,7 @@
/** @file script_date.cpp Implementation of ScriptDate. */
+#include <time.h>
#include "../../stdafx.h"
#include "script_date.hpp"
#include "../../date_func.h"
@@ -53,3 +54,10 @@
return ::ConvertYMDToDate(year, month - 1, day_of_month);
}
+
+/* static */ int32 ScriptDate::GetSystemTime()
+{
+ time_t t;
+ time(&t);
+ return t;
+}