Page 1 of 1

Time till Midnight

Posted: Mon Jan 22, 2007 1:34 pm
by Pezmc
I am trying to set a cookie that will expire at midnight, what is the easiest was to do this?

Posted: Mon Jan 22, 2007 2:00 pm
by feyd

Code: Select all

[feyd@home]>php -r "$t = strtotime('tomorrow'); $s = date('Y-m-d 00:00:00', $t); $t = strtotime($s); echo date('Y-m-d H:i:s', $t); echo PHP_EOL, $t - time();"
2007-01-23 00:00:00
35980