Date日期类 Date表示特定的时间,精确到毫秒; 构造方法: public Data() public Date(long date) 常用方法: public long getTime() public void setTime(long time) public Boolean before(Date when) public Boolean after(Date when) public int compareTo(Date anotherDate) public String toS…
错误的写法: SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //这里的格式也可以是别的 createAt =format.parse(y.getCreatedAt()); //此处是接收到的 2019-09-27T18:31:31+08:00 正确的写法: SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH…