<?php #https://moneyconvert.net/ $source = '2012-07-31'; $date = new DateTime($source); echo $date->format('d.m.Y'); // 31.07.2012 echo $date->format('d-m-Y'); // 31-07-2012 ?>