1.日期格式化:
Date d = new date();
SimpleDateFormat sdf = new
SimpleDateFormat("yyyy-MM-dd");
String dStr = sdf.format(d);
2.日期类型转换成Calender:
Date d = new date();
Calendar calender= Calendar.getInstance();
calender.setTime(d);
3.时间戳:
Timestamp ts = rs.getTimestamp("pdate");
SimpleDateFormat sdf = new
SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dStr = sdf.format(d);
4.日期处理:
获取当前系统时间:
1.)System.currentTimeMillis();
2.)new Date();
3.)Calender.getInstance();
字符串转换成日期类型:
String s = "1970-12-30 08:24:00.0";(.0纳秒)
Timestamp ts = Timestamp.valueOf(s);
时区的处理:
Calendar cJapan = new GregorianCalendar(TimeZone.getTimeZone("Japan"));
cJapan.get(Calendar.Hour_of_day);