This question already has an answer here:
- Convert one date format into another in PHP 15 answers
Am working on a date input in PHP whereby I am converting to ISO 8601 which is working fine. It is working fine but I need to remove the last characters which are in milliseconds
PHP code to convert to ISO 8601
//Getting the timezone
date_default_timezone_set('Africa/Nairobi');
//CONVERTING TO ISO 8601
$newDate = date('c', strtotime('+24 hours'));
dd($newDate);
//Output after dd
2018-10-25T14:34:44+03:00
I need to remove +03:00
so that the output will be 2018-10-25T14:34:44
</div>