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


C# DateTime.ToBinary方法代码示例

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


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

示例1: SetLastTime

        public void SetLastTime(DateTime in_time)
        {
            long timeBin = in_time.ToBinary();

            m_lastTimePsrt1 = (int)timeBin;
            m_lastTimePart2 = (int)(timeBin >> 32);
        }
开发者ID:mattlazarte,项目名称:AscentUnityProject,代码行数:7,代码来源:AkWwiseProjectData.cs

示例2: Start

    //public TestClass1 Tester2;
    //public List<TestClass1> Tests;
    //public List<ITriggerConditionTest> CondTest;
    public void Start()
    {
        //System.DateTime TestTime = new DateTime(2015, 12, 9, 14, 59, 30);
        System.DateTime TestTime = new DateTime(2015, 10, 8, 13, 59, 30);
        System.DateTime TestNowTime = new DateTime(System.DateTime.Now.Ticks);

        Debug.Log("TestTime " + TestTime);
        Debug.Log("NowTime " + TestNowTime);

        Debug.Log("TestTimeLong " + TestTime.ToBinary());
        Debug.Log("NowTimeLong " + TestNowTime.ToBinary());

        Debug.Log("timeGap " + (TestTime - TestNowTime));

        TimeSpan ts = TestTime - TestNowTime;

        Debug.Log("TimeGapDays Long " + ts.Days);
        Debug.Log("TimeGapMinutes Long " + ts.Minutes);
        Debug.Log("TimeGapTotalMinutes Long " + ts.TotalMinutes);
        Debug.Log("TimeGapSeconds Long " + ts.Seconds);
        Debug.Log("TimeGapTotalSeconds Long " + ts.TotalSeconds);
        // string으로 저장한 다음에 다시  long으로 변환해서 가져오장
        // 연.월.일 차이가 없어도 1씩 들어가 있으니까 빼자.
        // 빼기는
    }
开发者ID:TheManatthegate,项目名称:Goranee,代码行数:28,代码来源:GOTriggerTest.cs

示例3: addEvent

 public int addEvent(DateTime startTime,DateTime endTime,string title,int type,string extra,string detail)
 {
     //create event based on given data
     if(detail.Equals(null) && type == null){
         Node temp = new Node(title, startTime.ToBinary(), endTime.ToBinary());
     }else if(type == null){
         Node temp = new Node(title, detail, startTime.ToBinary(), endTime.ToBinary());
     }else if(detail.Equals(null)){
         Node temp = new Node(title, startTime.ToBinary(), endTime.ToBinary(), type, extra);
     }else{
         Node temp = new Node(title, detail,startTime.ToBinary(), endTime.ToBinary(), type, extra);
     }
     //add the event into list sorted by startTime
     if(eventList.Count!=0){
         int j=0;
         LinkedList<Node>.Enumerator e = eventList.GetEnumerator();
         while(e.MoveNext() && j!=1){
             if(DateTime(e.getStart()) <= DateTime(e.getStart())){
                 //check the end time
                 if(!e.checkRepeat(temp.getStart(), temp.getEnd())){
                     return -1;
                 }
                 //add to non-first and non-last point in list
                 if(DateTime(e.getStart()) != DateTime(eventList.First.getStart())){
          			temp.addBefore(e);
          		}else{
          			//add to first point in list
          			eventList.addFirst(temp);
          		}
          		j=1;
             }
         }
         if(j!=1){
         //add to end of list and check the end time
             if(!e.checkRepeat(temp.getStart(), temp.getEnd())){
                 return -1;
             }
      			eventList.AddLast(temp);
         }
     }else if(eventList.Count==0){
         eventList.addFirst(temp);
     }
     return 1;
 }
开发者ID:treinke,项目名称:project6NEW,代码行数:44,代码来源:list.cs

示例4: BinaryContains

    public static Boolean BinaryContains(SqlBytes AData, DateTime AValue)
    {
        if(AData.IsNull) return false;

        System.IO.BinaryReader r = new System.IO.BinaryReader(new System.IO.MemoryStream(AData.Buffer));

        #if DEBUG
        int LCount = r.ReadInt32();
        #else
        int LCount = Sql.Read7BitEncodedInt(r);
        #endif

        Int64 LValue = (Int64)AValue.ToBinary();
        for(; LCount > 0; LCount--)
          if(r.ReadInt64() == LValue) return true;

        return false;
    }
开发者ID:APouchkov,项目名称:ExtendedStoredProcedures,代码行数:18,代码来源:TListDateTime.cs

示例5: WriteDateTimeText

 public override void WriteDateTimeText(DateTime dt)
 {
     WriteTextNodeWithInt64(XmlBinaryNodeType.DateTimeText, dt.ToBinary());
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:4,代码来源:XmlBinaryWriter.cs


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