Difference of 1 day when storing value in "Date" field
Content
I'm trying to store a DoB value in a custom object field that is of type "Date". But there seems to be a difference of 1 day when the value is saved in the object. The code I'm using is:
$dob = "23/08/1965"; // this value is coming from the form
list($d, $m, $y) = explode("/", $dob);
$to_store_dob = $y."-".$m."-".$d;
$contact = new RNCPHP\Contact();
$contact->CustomFields->CO->Date_of_Birth = strtotime($to_store_dob);
.
.
$contact->save();
When I checked the value, it gets stored as "1965-08-22". This could be a timezone issue but I'm not sure how to use the correct timezone in the code. When I looked at the console taskbar, this is what I found out:
0