mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
Correct time initialization for the case where time is initialized from settings in the .config file. The correct range for month (tm_mon) internally is 0-11, not 1-12 as it is in the .config file.
This commit is contained in:
@@ -61,6 +61,7 @@
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Standard time definitions (in units of seconds) */
|
||||
|
||||
#define SEC_PER_MIN ((time_t)60)
|
||||
@@ -151,7 +152,7 @@ static inline int clock_basetime(FAR struct timespec *tp)
|
||||
* month, and date
|
||||
*/
|
||||
|
||||
jdn = clock_calendar2utc(CONFIG_START_YEAR, CONFIG_START_MONTH,
|
||||
jdn = clock_calendar2utc(CONFIG_START_YEAR, CONFIG_START_MONTH - 1,
|
||||
CONFIG_START_DAY);
|
||||
|
||||
/* Set the base time as seconds into this julian day. */
|
||||
|
||||
Reference in New Issue
Block a user