summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorKyle Luce <razzlegames@gmail.com>2016-03-12 19:13:57 -0700
committerKyle Luce <razzlegames@gmail.com>2016-03-13 15:27:39 -0700
commitfeef563f3f2ad7f1cb5aa2e788e3ea4adfee3c56 (patch)
treecb86c17f85513a4a4174d6628802d0059edb47f4 /platform
parentbe4d58e1203ae35dab97b14f08098f50998d4201 (diff)
Fixes the month consistency issue in enums and get_date etc
- Also updated the docs to reflect this. - Added some vim temp files to gitignore - Changed NaCL to be consistent with the other OS_Unix::get_date implementation (added 1 to month to map to 1-12) Ticket: https://github.com/godotengine/godot/issues/4025
Diffstat (limited to 'platform')
-rw-r--r--platform/nacl/os_nacl.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/platform/nacl/os_nacl.cpp b/platform/nacl/os_nacl.cpp
index de6a15525b..e2a92ee8c7 100644
--- a/platform/nacl/os_nacl.cpp
+++ b/platform/nacl/os_nacl.cpp
@@ -249,7 +249,11 @@ OS::Date OSNacl::get_date(bool utc) const {
lt=localtime(&t);
Date ret;
ret.year=lt->tm_year;
- ret.month=(Month)lt->tm_mon;
+
+ // Index starting at 1 to match OS_Unix::get_date
+ // and Windows SYSTEMTIME and tm_mon follows the typical structure
+ // of 0-11, noted here: http://www.cplusplus.com/reference/ctime/tm/
+ ret.month=(Month)(lt->tm_mon+1);
ret.day=lt->tm_mday;
ret.weekday=(Weekday)lt->tm_wday;
ret.dst=lt->tm_isdst;