示例#1
0
文件: DateLocal.php 项目: arbi/MyCode
 public static function convertDate($date)
 {
     if (empty($date)) {
         return '';
     }
     if (ClassicValidator::checkDateRegex($date)) {
         list($day, $month, $year) = explode(' ', $date);
         return $year . '-' . self::convertMonth($month) . '-' . $day;
     } else {
         throw new \Exception('Invalid date format.');
     }
 }