Soldato
- Joined
- 6 Dec 2002
- Posts
- 3,400
- Location
- North East
Hello,
I've searched everywhere trying to find a solution to this problem but nowhere seems to cover it
I'm trying to convert a date from a database from YYYY-MM-DD to D/M/Y so that is readable on the page, then transfer it back to to YYYY-MM-DD so it can be put back into the database. I've tried:
$d = date("d-m-Y", strtotime($d));
Which works perfectly and produces the desired viewable format, however the problem arises when converting it back to put back into the database
$d = date("Y-m-d", strtotime($d));
Doesn't seem to work, any ideas?
Thanks in advance,
BeatMaster
I've searched everywhere trying to find a solution to this problem but nowhere seems to cover it

I'm trying to convert a date from a database from YYYY-MM-DD to D/M/Y so that is readable on the page, then transfer it back to to YYYY-MM-DD so it can be put back into the database. I've tried:
$d = date("d-m-Y", strtotime($d));
Which works perfectly and produces the desired viewable format, however the problem arises when converting it back to put back into the database

$d = date("Y-m-d", strtotime($d));
Doesn't seem to work, any ideas?
Thanks in advance,
BeatMaster
