Example #1
0
Sophon_Result
sophon_date_to_time (Sophon_VM *vm, Sophon_Date *date, Sophon_Time *time)
{
	Sophon_Time t;
	Sophon_Result r;

	SOPHON_ASSERT(date && time);

	if ((r = date_to_time(vm, date, &t)) != SOPHON_OK)
		return r;

	*time = t;
	return SOPHON_OK;
}
Example #2
0
/*
 * Convert Gregorian date to seconds since 01-01-1970 00:00:00.
 */
int rtc_tm_to_time(struct rtc_time *tm, unsigned int *time)
{
	*time = date_to_time(tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
				tm->tm_hour, tm->tm_min, tm->tm_sec);
	return 0;
}