Hello I keep getting one error every now and again:

Warning: date() expects parameter 2 to be long, string given in /home/web/public_html/set.php on line 727

Below you can see that like ( 727) Any soluctions how to deal with this problem?

        <div class="bb"><?= date("d.m.y h:i:s",$full_list[ssctime]) ?><input type=hidden id="ssctime" value="<?=$full_list[ssctime]?>"></div>

Recommended Answers

All 4 Replies

Member Avatar for diafol

The 2 param must be an integer relating to a unix timestamp. It's just possible that this is blank or text?

Make sure $full_list[ssctime] is a timestamp. If there are characters in there, or perhaps when it is empty, it triggers this error. Where does that value come from?

Well it is used to save time for cache reset:

<DIV class="box1">
    <div class="dd" style="width:150px; text-align:left">
        <div class="bb"><h4>Next Cache Update</h4></div>
    </div>
    <div class="dd" style="width:350px;">
        <div class="bb"><?= date("d.m.y h:i:s",$full_list[ssctime]) ?><input type=hidden id="ssctime" value="<?=$full_list[ssctime]?>"></div>
    </div>
</DIV>

Once saved, it will be stored in text file, which values should i change to avoid this error?

You can try casting it:

(long)$full_list['ssctime'];
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.