Getting Unix timestamp for next day/hour<

admin

Administrator
Staff member
Hi, I wish to determine the unix timestamp for the next given day (0-6 where 0 is Sunday, 1 is Monday...) and hour (0-23 where 0 is 00:00 etc). Say if $day = 1 and $hour = 20 it would give you the unix timestamp for the upcoming Monday at 8 o'clock (PM).

I'd be greatful if you could help thanks.

ps I tried looking on php.net/manual but didn't understand the date/time functions too much. Thanksstrtotime() (<!-- m --><a class="postlink" href="http://us4.php.net/manual/en/function.strtotime.php">http://us4.php.net/manual/en/function.strtotime.php</a><!-- m -->)Hi cheers worked a treat. I've now run into another problem that when I use strtotime or time the time is one hour off but when I use getdate it's not. I'm wondering why this is and what I can do to overcome this problem. Note: I wish time tobe in GMT format. Thanksmore than likely a time-zone dfference. just add 1 hour to it before you convertyeah, doesn't getdate give local server time?it says

current local time if no timestamp is given
but I did it on my test server (local) and my sites server and they returned the same time. 2 hours different than my local time

I guess it matters where you do it at. I used a local file to get the time and it was correct for my time. pretty strange. :)
 
Back
Top