例如,将Mon Apr 27 09:08:20 CST 2015转化为2015-4-27 09:08:20
请问实现这个功能的JS代码应该怎么写呢?
使用toLocaleString()方法试下:
/**
* @return a string representation of this date, using the locale
* conventions.
*/
public String toLocaleString();
使用:
Date date = new Date();
date.toLocaleString()