skip to Main Content

Unable to get correct date format in php

I am trying to change date format but its showing me wrong result (showing me 1970-01-01),How can i fix this, i want dynamic date in "Y-m-d" format,Here is my code $start_date2=$_POST['start_date']; //showing 10-30-2022 echo $new_date = date("Y-m-d", strtotime($start_date2)); // showing…

VIEW QUESTION

Search mongodb data using the lt & gt comparators on the date

const queryMatch = {departureDate: {$gte: new Date(query.departureDateMin),$lte: new Date(query.departureDateMax)}}; const flightsByCriteria = await this.flightModel.find(queryMatch).exec(); The above request returns an empty table. And yet I get data with mongodbCompass using ISODate(dateString) instead of new Date(dateString) I don't know where the problem…

VIEW QUESTION
Back To Top
Search