public static String[] ymr(long time) {
String ymr[] = new String[3];
Date dt = new Date(time);
String year = String.format("%tY", dt);
String mon = String.format("%tm", dt);
String day = String.format("%td", dt);
ymr[0] = year;
ymr[1] = mon;
ymr[2] = day;
return ymr;
}
java 根据时间获取年、月、日
点赞
收藏