aboutsummaryrefslogtreecommitdiff
path: root/drivers/unix/os_unix.cpp
diff options
context:
space:
mode:
authorAnton Yabchinskiy2015-11-02 20:25:01 +0300
committerAnton Yabchinskiy2015-11-02 20:25:01 +0300
commit3b9868d2e44740c03861c64020a8b5d4d6da031d (patch)
tree8ff5f9671122f946487848ce286d336c9b650c2c /drivers/unix/os_unix.cpp
parentdc8df8a91a995796f0f330bf6bb6b209f6dfce08 (diff)
parentb2f9acb8c96aed0505cbac21661e21e4acef710f (diff)
downloadgodot-3b9868d2e44740c03861c64020a8b5d4d6da031d.tar.gz
godot-3b9868d2e44740c03861c64020a8b5d4d6da031d.tar.zst
godot-3b9868d2e44740c03861c64020a8b5d4d6da031d.zip
Merge branch 'master' of github.com:okamstudio/godot
Diffstat (limited to 'drivers/unix/os_unix.cpp')
-rw-r--r--drivers/unix/os_unix.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index f6d9e0fb4..8617061ad 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -223,6 +223,15 @@ uint64_t OS_Unix::get_unix_time() const {
return time(NULL);
};
+uint64_t OS_Unix::get_system_time_msec() const {
+ struct timeval tv_now;
+ gettimeofday(&tv_now, NULL);
+ //localtime(&tv_now.tv_usec);
+ //localtime((const long *)&tv_now.tv_usec);
+ uint64_t msec = uint64_t(tv_now.tv_sec)*1000+tv_now.tv_usec/1000;
+ return msec;
+}
+
OS::Date OS_Unix::get_date(bool utc) const {
@@ -234,7 +243,7 @@ OS::Date OS_Unix::get_date(bool utc) const {
lt=localtime(&t);
Date ret;
ret.year=1900+lt->tm_year;
- ret.month=(Month)lt->tm_mon;
+ ret.month=(Month)(lt->tm_mon + 1);
ret.day=lt->tm_mday;
ret.weekday=(Weekday)lt->tm_wday;
ret.dst=lt->tm_isdst;