mirror of
https://github.com/apache/nuttx.git
synced 2026-10-06 05:47:54 +00:00
Correct a problem in clock_gettime(CLOCK_REALTIME, &time); which is ahead by 1 month of the specified CONFIG_START_MONTH
This commit is contained in:
parent
d9c2789253
commit
1796a25e53
1 changed files with 2 additions and 2 deletions
|
|
@ -91,8 +91,8 @@ static const uint16_t g_daysbeforemonth[13] =
|
|||
|
||||
int clock_daysbeforemonth(int month, bool leapyear)
|
||||
{
|
||||
int retval = g_daysbeforemonth[month];
|
||||
if (month >= 2 && leapyear)
|
||||
int retval = g_daysbeforemonth[month-1];
|
||||
if (month > 2 && leapyear)
|
||||
{
|
||||
retval++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue