Good morning, I'm passing the server a string that would be for time: 23:45 is an example.
In my $ _GET I'm trying to convert this way:
$prazo_entrega_min = time("hh:mm", strtotime($_GET['prazo_entrega_min']));
But to no avail. What can I do?
I'm using the ionicTimePicker plugin ( link in my controller to get this date):
// TEMPO ENTREGA MINIMO
var ipObj1 = {
callback: function (val) { //Mandatory
if (typeof (val) === 'undefined') {
console.log('Time not selected');
} else {
var selectedTime = new Date(val * 1000);
console.log(selectedTime.getUTCHours(), 'H :', selectedTime.getUTCMinutes(), 'M');
$scope.entrega_min = selectedTime.getUTCHours() + ':' + selectedTime.getUTCMinutes();
window.localStorage.setItem("prazo_min_entrega", $scope.entrega_min)
console.log($scope.entrega_min);
}
},
inputTime: 50400, //Optional
format: 24, //Optional
step: 15, //Optional
setLabel: 'OK' //Optional
};
$scope.openTimePicker = function () {
ionicTimePicker.openTimePicker(ipObj1);
};
I am storing in my localstorage the values just to check, they are all in string:
What do I do wrong?