"warning: date() expects parameter 2 to be long, string given in" Answer’s

0

date() expects a unix timestamp... I imagine you are passing it a date as a string.

e.g. 2010-10-10

You should use:

$this->expiry_date = date("m/d/Y", strtotime($rows['expiry_date']));

Or better yet, use the DateTime object.

$expiry_date = new DateTime($rows['expiry_date']);
$this->expiry_date = $expiry_date->format('m/d/Y');
Wednesday, March 31, 2021
 
KingCrunch
answered 11 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :
 
Share