0

I am doing php parsing and getting date like Thu 1 Dec and I want to store it in database and my date column in database is of DATE type, so when I store this in database, it inserts 0000-00-00 because of improper format. How can I convert it into proper format?

Ashna Ali
  • 33
  • 1
  • 6

1 Answers1

0

To format the date properly, use something like this

$Date = Date('c', strtotime($Date))

The date has to be something strtotime can understand, but strtotime can understand a lot.

Erik A
  • 31,639
  • 12
  • 42
  • 67