当前位置: 首页>>代码示例>>C#>>正文


C# Date.getMonth方法代码示例

本文整理汇总了C#中Date.getMonth方法的典型用法代码示例。如果您正苦于以下问题:C# Date.getMonth方法的具体用法?C# Date.getMonth怎么用?C# Date.getMonth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Date的用法示例。


在下文中一共展示了Date.getMonth方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: test_Date_getDateAsString

 public void test_Date_getDateAsString()
 {
     string dd =  "2005-02-02T14:56:11Z";
       Date date = new  Date(dd);
       assertTrue( date != null );
       assertTrue( date.getYear() == 2005 );
       assertTrue( date.getMonth() == 2 );
       assertTrue( date.getDay() == 2 );
       assertTrue( date.getHour() == 14 );
       assertTrue( date.getMinute() == 56 );
       assertTrue( date.getSecond() == 11 );
       assertTrue( date.getSignOffset() == 0 );
       assertTrue( date.getHoursOffset() == 0 );
       assertTrue( date.getMinutesOffset() == 0 );
       date.setYear(2012);
       date.setMonth(3);
       date.setDay(28);
       date.setHour(23);
       date.setMinute(4);
       date.setSecond(32);
       date.setSignOffset(1);
       date.setHoursOffset(2);
       date.setMinutesOffset(32);
       assertTrue((  "2012-03-28T23:04:32+02:32" == date.getDateAsString() ));
       date = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:26,代码来源:TestModelHistory.cs

示例2: test_Date_setDateAsString

 public void test_Date_setDateAsString()
 {
     Date date = new  Date(2007,10,23,14,15,16,1,3,0);
       assertTrue( date != null );
       int i = date.setDateAsString( "20081-12-30T12:15:45+02:00");
       assertTrue( i == libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE );
       assertTrue((  
                        "2007-10-23T14:15:16+03:00" == date.getDateAsString() ));
       i = date.setDateAsString( "200-12-30T12:15:45+02:00");
       assertTrue( i == libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE );
       assertTrue((  
                        "2007-10-23T14:15:16+03:00" == date.getDateAsString() ));
       i = date.setDateAsString("");
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue((  
                    "2000-01-01T00:00:00Z" == date.getDateAsString() ));
       i = date.setDateAsString( "2008-12-30T12:15:45+02:00");
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( date.getYear() == 2008 );
       assertTrue( date.getMonth() == 12 );
       assertTrue( date.getDay() == 30 );
       assertTrue( date.getHour() == 12 );
       assertTrue( date.getMinute() == 15 );
       assertTrue( date.getSecond() == 45 );
       assertTrue( date.getSignOffset() == 1 );
       assertTrue( date.getHoursOffset() == 2 );
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:26,代码来源:TestDate_newSetters.cs

示例3: test_Date_create

 public void test_Date_create()
 {
     Date date = new  Date(2005,12,30,12,15,45,1,2,0);
       assertTrue( date != null );
       assertTrue( date.getYear() == 2005 );
       assertTrue( date.getMonth() == 12 );
       assertTrue( date.getDay() == 30 );
       assertTrue( date.getHour() == 12 );
       assertTrue( date.getMinute() == 15 );
       assertTrue( date.getSecond() == 45 );
       assertTrue( date.getSignOffset() == 1 );
       assertTrue( date.getHoursOffset() == 2 );
       assertTrue( date.getMinutesOffset() == 0 );
       date = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:15,代码来源:TestModelHistory.cs

示例4: test_Date_createFromString

 public void test_Date_createFromString()
 {
     string dd =  "2012-12-02T14:56:11Z";
       Date date = new  Date(dd);
       assertTrue( date != null );
       assertTrue((  "2012-12-02T14:56:11Z" == date.getDateAsString() ));
       assertTrue( date.getYear() == 2012 );
       assertTrue( date.getMonth() == 12 );
       assertTrue( date.getDay() == 2 );
       assertTrue( date.getHour() == 14 );
       assertTrue( date.getMinute() == 56 );
       assertTrue( date.getSecond() == 11 );
       assertTrue( date.getSignOffset() == 0 );
       assertTrue( date.getHoursOffset() == 0 );
       assertTrue( date.getMinutesOffset() == 0 );
       date = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:17,代码来源:TestModelHistory.cs

示例5: test_Date_assignmentOperator

 public void test_Date_assignmentOperator()
 {
     Date date = new Date(2005,12,30,12,15,45,1,2,0);
       assertTrue( date.getMonth() == 12 );
       assertTrue( date.getSecond() == 45 );
       Date date2 = new Date();
       date2 = date;
       assertTrue( date2.getMonth() == 12 );
       assertTrue( date2.getSecond() == 45 );
       date2 = null;
       date = null;
 }
开发者ID:0u812,项目名称:roadrunner-backup,代码行数:12,代码来源:TestCopyAndClone.cs

示例6: test_Date_copyConstructor

 public void test_Date_copyConstructor()
 {
     Date date = new Date(2005,12,30,12,15,45,1,2,0);
       assertTrue( date.getMonth() == 12 );
       assertTrue( date.getSecond() == 45 );
       Date date2 = new Date(date);
       assertTrue( date2.getMonth() == 12 );
       assertTrue( date2.getSecond() == 45 );
       date2 = null;
       date = null;
 }
开发者ID:0u812,项目名称:roadrunner-backup,代码行数:11,代码来源:TestCopyAndClone.cs

示例7: test_Date_clone

 public void test_Date_clone()
 {
     Date date = new Date(2005,12,30,12,15,45,1,2,0);
       assertTrue( date.getMonth() == 12 );
       assertTrue( date.getSecond() == 45 );
       Date date2 = (Date) date.clone();
       assertTrue( date2.getMonth() == 12 );
       assertTrue( date2.getSecond() == 45 );
       date2 = null;
       date = null;
 }
开发者ID:0u812,项目名称:roadrunner-backup,代码行数:11,代码来源:TestCopyAndClone.cs

示例8: test_Date_setters

 public void test_Date_setters()
 {
     Date date = new  Date(2005,12,30,12,15,45,1,2,0);
       assertTrue( date != null );
       date.setYear(2012);
       date.setMonth(3);
       date.setDay(28);
       date.setHour(23);
       date.setMinute(4);
       date.setSecond(32);
       date.setSignOffset(1);
       date.setHoursOffset(2);
       date.setMinutesOffset(32);
       assertTrue( date.getYear() == 2012 );
       assertTrue( date.getMonth() == 3 );
       assertTrue( date.getDay() == 28 );
       assertTrue( date.getHour() == 23 );
       assertTrue( date.getMinute() == 4 );
       assertTrue( date.getSecond() == 32 );
       assertTrue( date.getSignOffset() == 1 );
       assertTrue( date.getHoursOffset() == 2 );
       assertTrue( date.getMinutesOffset() == 32 );
       assertTrue((  "2012-03-28T23:04:32+02:32" == date.getDateAsString() ));
       date = null;
 }
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:25,代码来源:TestModelHistory.cs

示例9: assertTrue

              i = date.setMinutesOffset(45);
              assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
              assertTrue( date.getMinutesOffset() == 45 );
              assertTrue((  
                           "2005-12-30T12:15:45+02:45" == date.getDateAsString() ));
              date = null;
        }

        public void test_Date_setMonth()
        {
            Date date = new  Date(2005,12,30,12,15,45,1,2,0);
              assertTrue( date != null );
              int i = date.setMonth(434);
              assertTrue( i == libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE );
              assertTrue( date.getMonth() == 1 );
              i = date.setMonth(12121);
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:16,代码来源:TestDate_newSetters.cs


注:本文中的Date.getMonth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。