How to handle datetime between php (Laravel api) and javascript (AngularJS)
问题 I'm utterly stuck trying to make php api exchange dates with angular frontend. From PHP to JS I seem to have it sorted. Since Laravel handles dates through Carbon I just added \Carbon\Carbon::setToStringFormat('c'); to app.php which makes dates come out in ISO 8601. PHP example: 2015-02-04T00:53:51+02:00 AngularJS date filter also seems to understand this format well and even reads the timezone correctly. What I have yet to get working is posting JS date objects back to PHP api. JS example: