完整工具类代码链接:https://download.csdn.net/download/d_c_hao/10910133
/**
* String转为UFDate
*/
public static UFDate StringToUFDate( String time ) throws ParseException{
if( time == null ){
return null ;
}else{
SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy/MM/dd");
UFDate date = new UFDate( timeFormat.parse( time ) ) ;
return date ;
}
}
/**
* String转 UFDateTime
*/
public static UFDateTime StringToUFDateTime( String time ) throws ParseException{
if( time == null ){
return null ;
}else{
SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
UFDateTime date = new UFDateTime( timeFormat.parse( time ) ) ;
return date ;
}
}