中间的月份是英文三个字母的缩写,怎么把它转换成Date对象呢?

解决方案 »

  1.   

    '****************************************************   
      '过程名:trun_date   
      '作     用:转换日期格式为sep26.2006   
      '参     数:mydate-----日期   
      '****************************************************   
      Function   trun_date(mydate)   
      my=month(mydate)   
      if   my="1"   then   mymonth="Jan"   
      if   my="2"   then   mymonth="Feb"   
      if   my="3"   then   mymonth="Mar"   
      if   my="4"   then   mymonth="Apr"   
      if   my="5"   then   mymonth="May"   
      if   my="6"   then   mymonth="Jun"   
      if   my="7"   then   mymonth="Jul"   
      if   my="8"   then   mymonth="Aug"   
      if   my="9"   then   mymonth="Sep"   
      if   my="10"   then   mymonth="Oct"   
      if   my="11"   then   mymonth="Nov"   
      if   my="12"   then   mymonth="Dec"   
      my2=day(mydate)   
      if   len(my2)="1"   then   my2="0"&my2   
      trun_date=mymonth&my2&",   "&year(mydate)   
      End   Function
      

  2.   

    只剩这一个办法了么。。?js的date对象不能解析这类日期么?
      

  3.   


    var strDate = "04-May-2008";
    var d = new Date(strDate.replace(/-/g,","));
    alert(d);