function sortChar(e1,e2){
  if(e1 == e2) return 0;
  return (e1>e2?-1:1)
}MyArray.sort(sortChar);

解决方案 »

  1.   

    xuzuning(唠叨)
    我用了你的方法还是顺序排列。还有其他的方法吗?
      

  2.   

    <script>
    MyArray = new Array(
    "2003-10-01 02:02:33",
    "2003-08-01 02:02:33",
    "2003-12-01 02:02:33",
    "2003-11-01 02:02:33"
    );function sortChar(e1,e2){
      if(e1 == e2) return 0;
      return (e1>e2?-1:1) //降序
    //  return (e1>e2?1:-1) //升序
    }MyArray.sort(sortChar);
    for(i=0;i<MyArray.length;i++)
      document.write(MyArray[i]+"<br>");
    </script>
      

  3.   

    http://expert.csdn.net/Expert/topic/2206/2206556.xml?temp=.9118158
    大家去看看吧,相信你会感兴趣的,一个javascript问题,具难!