开发者

Working out starting time when user has chosen the gmt time

开发者 https://www.devze.com 2023-04-04 05:15 出处:网络
I have a loop that checks to see if a user\'s daily game has started based on time().The event starting time is based on the GMT time that the user has chosen.

I have a loop that checks to see if a user's daily game has started based on time(). The event starting time is based on the GMT time that the user has chosen.

My problem is that I can't seem to work out how to get the starting time - once a day I loop through the database and create all the games for the day; if a user chooses the GMT time of 20 (for example) how do I work out the time() for the next time GMT20 occurs.

EDIT: I think the assumption here is that the daily loop is made at GMT +0, it's not. The daily loop can be anytime during the day, it happens after a certain event happens. So I need the NEXT 开发者_如何转开发unix timestamp where GMT +20 (for example) happens.


How is your date stored? As a unix time stamp? Just add 24 hours to it (in seconds).

<?
$time=$time+(24*60*60);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号