zoukankan      html  css  js  c++  java
  • 小解时间格式C#

     //DateTime.Parse()的作用就是把指定的字符串转换成DateTime类型,当然字符串要符合一定的格式
    //不能是Ticks(长整型的18位数字),如果是字符串就只能是下面样式的写法
    Console.WriteLine(DateTime.Parse("2012/12/12"));
    ------------------------------ 

    //构造一个DateTime是有很多方法的常用的就这几种

    DateTime dt = new DateTime(621355968000000000);
    //DateTime dt = new DateTime(2012,12,14);
    int a = int.Parse("1");
    Console.WriteLine(a);
    Console.WriteLine(DateTime.MinValue+"   "+DateTime.MaxValue+"   "+dt.Kind+"   "+dt.Ticks);

    Console.WriteLine(dt.Date);

    Console.ReadKey();
    ------------------
    DateTime dt = new DateTime(2012,3,23);

    DateTime dt2 = dt.AddDays(1);

    Console.WriteLine("今天是{0},明天是{1}",DateTime.Now,dt2.Date);
     Console.ReadKey();
  • 相关阅读:
    线程安全,syncronized 用法
    线程
    Log4j2
    线性规划
    不要在using语句中调用WCF服务
    kibana 查询语法
    ES中DSL查询相关
    ES通过API调整设置
    ElasticSearch架构思考(转)
    Elasticsearch集群UNASSIGNED
  • 原文地址:https://www.cnblogs.com/zhangran/p/2414255.html
Copyright © 2011-2022 走看看