Jump to content

Custom date format, to MySQL date


Recommended Posts

Hi there,


I have a string '12/04/1990', that's in the format dd/mm/yyyy.


I'm attempting to convert that string to a Date, and then insert that date into a MySQL DATE field.


The problem is, every time I try to do so, I keep getting values like this in the database: 1970-01-01.



Any ideas?



Much appreciated.



Link to comment
Share on other sites

Show us some code and I'll take a look for you.


I currently have this: Date("Y-m-d", $this->dob);


...which outputs 1970-01-01 and is stored in the database.


I need a way of formatting that custom date string ($this->dob) into a format that MySQL can understand which is(Y-m-d).


But I don't know how :(

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.