如何获取当前时间到第2天凌晨00:00:00剩余的秒数

如题所述

第1个回答  2017-01-20
思路, 24hour - (now - start of today)
/* difftime example */
#include <stdio.h> /* printf */
#include <time.h> /* time_t, struct tm, difftime, time, mktime */
int main ()
{
time_t now = time(NULL);
struct tm today = *localtime(&now);
double seconds;
today.tm_hour = 0; today.tm_min = 0; today.tm_sec = 0;
seconds = 24*60*60-difftime(now,mktime(&today));
printf (" %.f seconds left today\n" seconds);
return 0;
}本回答被网友采纳
第2个回答  2017-01-20
(23-date('H'))*60*60+(59-date('i'))*60+59-date('s')+1
还有一个方法

$data = date('Ymd');
echo strtotime($data+1)-time();die;