|
Posted by Pupkin on 10/07/06 00:13
Hi,
I need to set some content to only show after a given date and time.
Like:
<?
$livedate = "October 06 2006 17:45";
if (date("r") > $livedate) { ?>
Content here
<? } ?>
I'm used to ASP, where I've gotten into trouble by not forcing my text
string date/time into the datetime format, so the if-then statement was
not comparing like-to-like (and several days or hours later, when a
single digit element changed to two-digits, the code would return
unintended results).
Is this something I need to worry about with PHP?
I've tried some experiments force-formatting my text string date/time
with date($livedate), mktime(livedate), etc., but I never end up with
anything that resembles the date("r").
What do I need to learn to get this to work with reliable results?
Thanks.
Navigation:
[Reply to this message]
|