各种数据类型转换

来源:互联网 发布:综合网络弱电系统图 编辑:程序博客网 时间:2024/05/21 10:57

1. 时间类型&&String 互转

SimpleDateFormat sdf = new SimpleDateFormat("YYYY-MM-DD");

Date birthDay = sdf.parse(birthDayStr);

String birthDay = sdf.format(System.currentTimeMillis());

注:System.currentTimeMillis() 获取当前时间

0 0