建议你到http://www.my97.net/下载个日历控件,方便多了

解决方案 »

  1.   

    http://msdn.microsoft.com/zh-cn/library/ch92fbc1(v=vs.100).aspx
      

  2.   

       // The example displays the following output:
                //    Attempting to parse strings using en-US culture.
                //       Converted '05/01/2009 14:57:32.8' to 5/1/2009 2:57:32 PM (Unspecified).
                //       Converted '2009-05-01 14:57:32.8' to 5/1/2009 2:57:32 PM (Unspecified).
                //       Converted '2009-05-01T14:57:32.8375298-04:00' to 5/1/2009 11:57:32 AM (Local).
                //       Converted '5/01/2008 14:57:32.80 -07:00' to 5/1/2008 2:57:32 PM (Local).
                //       Converted '1 May 2008 2:57:32.8 PM' to 5/1/2008 2:57:32 PM (Unspecified).
                //       Unable to parse '16-05-2009 1:00:32 PM'.
                //       Converted 'Fri, 15 May 2009 20:10:57 GMT' to 5/15/2009 1:10:57 PM (Local).
    这样子的结果不是我想要的,我希望是 年加月, 可以吗
      

  3.   

    使用日历控件   http://www.oschina.net/project/tag/278/jquery-calendar
      

  4.   

     @"^((1[6-9]|[2-9]\d)\d{2})-(0\d|1[012])$"
      

  5.   


    string str = "2013-12";
    bool bl = Regex.IsMatch(str,"^\\d{4}-(0[1-9]|1[12])$");//验证格式为:2013-01,月份必须2位数
      

  6.   

    最偷懒的方法就是ajax到服务器端Convert,成功就是日期,失败就是格式错误
    反正不管你在前端做什么验证,后端总要再检查一遍