Java SimpleDateFormat Pattern for JavaScript Date

前端 未结 4 1643
时光说笑
时光说笑 2020-12-07 03:04

I need to convert a Java Date object to a string that is the same format as JavaScript Dates when they are converted to a string. On our server we have JavaScript dates that

4条回答
  •  一个人的身影
    2020-12-07 03:28

    SimpleDateFormat format = new SimpleDateFormat("EEE MMM dd yyyy '00:00:00'  zZ");
    Date date = arrayOfDates[i];
    String dateStr = format.format(date);
    

提交回复
热议问题