laravel change date value format from db and compare it to current date
i am trying to compare my date value in the database to the current date but the date formats are different..how can i change the retrieved date from the db and compare it to the current date at the same time?? please help....
First, is start_date actually a column in the database or are you getting this from a datepicker or something? If it's a db field, what is the type of field? It sounds like you are using a varchar (instead of a datetime/timestamp/etc) since you are saying your date format is 'd M Y-H:i'. We need more info in order to give you accurate advise.
Then I think you have to cast it to a date in the query, otherwise it won't be able to compare dates (since it's a string in the database and not a date object).
You really should use a datetime or something for the field if you want to be able to use date operations/comparisons on them.