Rui Gonçalves Rui Gonçalves - 1 year ago 79
PHP Question

Convert to date format dd/mm/yyyy

I have the following date: 2010-04-19 18:31:27. I would like to convert this date to the dd/mm/yyyy format.

Answer Source

You can use a regular expression or some manual string fiddling, but I think I prefer:

date("d/m/Y", strtotime($str));
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download