public static function convertDate($dateString, $fromFormat, $toFormat)
    {
        $date = DateTime::createFromFormat($fromFormat, $dateString);
        if (!$date && $fromFormat == DateFormat::FORMAT_ORACLE_WITH_MICROSECONDS) {
            $date = DateTime::createFromFormat(DateFormat::FORMAT_ORACLE_DATE_ONLY, $dateString);
        }

        if ($date) {
            return $date->format($toFormat);
        }
        return $dateString;
    }