我有一个Date值,想要显示月份的日期。看起来getDays方法返回的是星期几。
有没有办法获得一个月的日期?
发布于 2019-02-09 15:06:48
如果你有unixTime,就用我的方法:
public int getDayInt(long unixTime) {
return Integer.parseInt(DateFormat.format("dd", new Date(unixTime)).toString());
}或者如果你有约会的话:
public int getDayInt(Date date) {
return Integer.parseInt(DateFormat.format("dd", date).toString());
}https://stackoverflow.com/questions/5925210
复制相似问题