PHP的明天日出时间.怎么样?

Chi*_*rag 2 php time

这是我的脚本,计算今天圣何塞的日出时间,但如果我想明天得到它,我该怎么办呢?

<?php

//San Jose, CA
$lat = 37.339386;    // North
$long = -121.894955;    // East
$offset = -8;    // difference between GMT and local time in hours

$zenith=90+50/60;
echo "<br><p>Sunrise: ".date_sunrise(time(), SUNFUNCS_RET_STRING, $lat, $long, $zenith, $offset);
echo "<br>Sunset: ".date_sunset(time(), SUNFUNCS_RET_STRING, $lat, $long, $zenith, $offset);
?>
Run Code Online (Sandbox Code Playgroud)

Lee*_*Lee 8

PHP函数,time()以"The Epoch"为单位,以秒为单位显示当前时间.您可以使用strtotime()许多不同的转化,包括相对转化.

您可以使用strtotime()从现在开始的1天时间:

strtotime("+1 day");
Run Code Online (Sandbox Code Playgroud)

只需time()在代码中替换即可strtotime("+1 day")