$sql = "SELECT `date`
FROM `accounts`
WHERE `username` = '$username'
";
$res = mysql_query($sql) or die (mysql_error());
$date = new DateTime($res['date']);
echo $date->format('d.m.Y');
ini_set('session.bug_compat_warn', 0);
ini_set('session.bug_compat_42', 0);