In our last episode,
< XXXX@XXXXX.COM >,
the lovely and talented XXXX@XXXXX.COM
broadcast on comp.lang.php:
try echo $banned_until here to see if you really are getting a value.
The answer probably is that you are getting a string, not time, which
is expressed in an integer number of seconds.
This is because $banned_until = 0. I suspect your problem is not
in date but that you are not what you think from the database.
of course you could make date2 = date('Y-m-d h:m:s'); which evidently is the
format you are getting from the database. This of course has the
disadvantage of being obviously correct.
Aha! The plot thickens!
Okay. date wants the second parameter to be a number for time, a big-ass
integer in this case. What you are getting from the database is a string.
How to change a string to time? How? How?
$date1 = date('Y-m-d',strtotime($banned_until));
Note: the above contains *two* hints at *different* solutions. If you do
both of them, it won't work. Pick one.
Lars Eighner < http://www.yqcomputer.com/
Countdown: 257 days to go.