publicstatic String ms2Date(long _ms){
Date date =newDate(_ms);
SimpleDateFormat format =newSimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());return format.format(date);}publicstatic String ms2DateOnlyDay(long _ms){
Date date =newDate(_ms);
SimpleDateFormat format =newSimpleDateFormat("yyyy-MM-dd", Locale.getDefault());return format.format(date);}
标准时间转换为时间戳
publicstaticlongDate2ms(String _data){
SimpleDateFormat format =newSimpleDateFormat("yyyy-MM-dd HH:mm:ss");try{
Date date = format.parse(_data);return date.getTime();}catch(Exception e){return0;}}