Time::getMonth() returns wrong month on Windows


#1

This test was made on december 5th 2009:
Time::getMonth() currently returns 11 on Windows (as it is december right now, it obviously should return 12).
In the struct t.tm_yday has a value of 338 but december 5th 2009 is day 339.
This should be corrected.

It would also be nice if it was possible to access the day of the year from a time object as it is calculated anyways, you could just add a function that returns this value. This is currently missing.


#2

Jules uses ctime’s time_t for handling time related stuff.

Time structure

[quote]Fields of the tm struct (C++ syntax):

struct tm
{
int tm_sec; // seconds after minute 0…60
int tm_min; // minutes after hour 0…59
int tm_hour; // hours since midnight 0…23
int tm_mday; // day of month 1…31
int tm_mon; // months since January 0…11
int tm_year; // years since 1900
int tm_wday; // days since Sunday 0…6
int tm_yday; // days since January 1 0…365
int tm_isdst; // Daylight Saving Time flag
};[/quote]

Jules can change it but it won’t be the standard way of doing it.


#3

[quote=“friscokid”]This test was made on december 5th 2009:
Time::getMonth() currently returns 11 on Windows (as it is december right now, it obviously should return 12).
In the struct t.tm_yday has a value of 338 but december 5th 2009 is day 339.
This should be corrected.[/quote]

The documentation explains that clearly does it not:


#4

Sorry, I really don’t know how I could miss that.
Thanks


#5