tags:

views:

36

answers:

1

I have the following code to determine the unix timestamp of midnight tomorrow. It seems pretty hacky to me and I wondered if anyone had a more elegant solution.

date("U", strtotime(date("Y-m-d 00:00:00", strtotime("tomorrow"))));
+1  A: 

This should be enough:

<?php
$t = strtotime('tomorrow');
?>

You can also set a time:

<?php
$t = strtotime('tomorrow 14:55');
?>
Álvaro G. Vicario
`strtotime("midnight tomorrow")` also seems to work :)
Ben James
@Ben James: Nice to know. I've Googled lots of times for the exact specs but there don't seem to be any apart from an incomplete man page and the original C code...
Álvaro G. Vicario
Well don't I feel like a goof. Thanks for the quick reply.
Ben Mcmath