提交 86ad6903 编写于 作者: Z zylx

[kernel][kservice] add comment

上级 ab5f1d49
......@@ -1177,6 +1177,12 @@ void rt_kprintf(const char *fmt, ...)
RTM_EXPORT(rt_kprintf);
#endif
/**
* This function will convert Time (Restartable)
*
* @param timep the timestamp
* @param result the structure to stores information
*/
struct tm *rt_gmtime_r(const time_t *timep, struct tm *result)
{
#define IS_LEAP_YEAR(year) (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0))
......@@ -1206,6 +1212,7 @@ struct tm *rt_gmtime_r(const time_t *timep, struct tm *result)
break;
}
result->tm_year = year - 1900;
result->tm_yday = daycount;
while (daycount >= 28)
{
......@@ -1225,7 +1232,7 @@ struct tm *rt_gmtime_r(const time_t *timep, struct tm *result)
}
month++;
}
result->tm_mon = month + 1;
result->tm_mon = month;
result->tm_mday = daycount + 1;
}
return result;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册