Fix coding style and simplify seconds_since_midnight() a bit
This commit is contained in:
parent
f331432459
commit
273875a68c
1 changed files with 1 additions and 4 deletions
|
@ -217,15 +217,12 @@ static int
|
|||
seconds_since_midnight(time_t time)
|
||||
{
|
||||
struct tm *tm = localtime(&time);
|
||||
time_t midnight;
|
||||
|
||||
tm->tm_hour = 0;
|
||||
tm->tm_min = 0;
|
||||
tm->tm_sec = 0;
|
||||
tm->tm_isdst = -1;
|
||||
midnight = mktime(tm);
|
||||
|
||||
return(time - midnight);
|
||||
return time - mktime(tm);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue