date_default_timezone_set('Europe/Helsinki');
$sql = "SELECT time_on_reg, expire_date FROM tablicata ASC LIMIT 50";
$do = mysql_query($sql);
while($get = mysql_fetch_array($do))
{
$reg_date = new DateTime($get['time_on_reg']);
$exp_date = new DateTime($get['expire_date']);
echo $reg_date->format('F jS Y');
echo $exp_date->format('F jS Y');
}