$seconds = mktime(0,0,0, date("n"), date("j") + (7 - date("N")), date("Y")) - time();
This line will give you the difference in seconds from today until Sunday morning at 12:00. You can configure the first 3 arguments in mktime () to give you a variable time of day (e.g. 8:45 a.m.).
Geoffrey Wagner Jan 14 2018-11-14T00: 00Z
source share