I want to know what is the correct format for storing such type of date.
how to fix it ?
Your code is give issue in wrong results because your date is in a format (m/Y/d h:i:s) that is not recognised by strtotime. Instead, use date_create_from_format to convert it and output a date in the correct form for SQL. For example: