Convert dd.mm.yy to dd.mm.yyyy

Hi,
i want to change Original text: dd.mm.yy
to new text: dd.mm.20yy
eg: 30.10.21 to 30.10.2021
How can i do it with PHP
thank you

echo date('m.d.Y', strtotime('30.10.21'));

thanks
But my result is 1970. Do you have other solution

^ ?? Huh?

This:

echo date('m.d.Y', strtotime('30.10.21'));

Outputs:

10.30.2021

There is no 1970 -ANYWHERE- If you wanted to USE 1970… (you should have stated as such)

echo date('m.d.Y', strtotime('30.10.70'));

Outputs:

10.30.1970

Did you even give it a try and edit it?

Sponsor our Newsletter | Privacy Policy | Terms of Service