<?php

namespace {
    function convertDatetime($time, $from, $to = 'Y-m-d H:i:s') {
        $dt = \DateTime::createFromFormat($from, $time);
        if(!$dt) {
            $dt = new \DateTime($time);
        }
        return $dt->format($to);
    }
}
