summaryrefslogtreecommitdiff
path: root/drivers/unix
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2016-03-13 23:50:29 +0100
committerRémi Verschelde <remi@verschelde.fr>2016-03-13 23:50:29 +0100
commit942157bde3687baefca3aea48c8773d37a52e527 (patch)
treecb86c17f85513a4a4174d6628802d0059edb47f4 /drivers/unix
parentbe4d58e1203ae35dab97b14f08098f50998d4201 (diff)
parentfeef563f3f2ad7f1cb5aa2e788e3ea4adfee3c56 (diff)
Merge pull request #4027 from Razzlegames/fixMonthConsistency
Fixes the month consistency issue in enums (OS::Month) and get_date etc
Diffstat (limited to 'drivers/unix')
-rw-r--r--drivers/unix/os_unix.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index a004a116e0..84b6dc24dc 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -251,6 +251,9 @@ OS::Date OS_Unix::get_date(bool utc) const {
lt=localtime(&t);
Date ret;
ret.year=1900+lt->tm_year;
+ // 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;