import java.text.ParseException;
public static void main(String[] args) throws ParseException{
Date date;
String da = "2008-12-28 22:29:30";
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
long time = df.parse(da).getTime();
System.out.println(time);
date = new Date(time);
System.out.println(df.format(date));
}
Date,Long与String之间的转换
最新推荐文章于 2023-02-15 10:13:42 发布