2020년 8월 12일 수요일

[Unity] dateTime to string,string to DateTime Convert[유니티] 시간을 글자로,글자를 시간으로 변환

 

 key 

key = x.Fce_No + x.endDate.Substring(014);

//가열로 번호 + endDate시간을 key로잡고

model에서는 받은 시간을 바탕으로 데이터를 뽑아낸다






foreach (var x in currentModelData._kPI3Items)
        {
            foreach (var item in dic_date)
            {
                
                if (string.Compare(x.Fce_No.ToString(), item.Key.Substring(01)) ==0// FceNo이 같고
                {
                    Debug.Log("key:" + item.Key);
                    CurrnetDate = DateTime.ParseExact(item.Key.Substring(114), "yyyyMMddHHmmss",null);
                    prevDate = CurrnetDate.AddHours(-12);

                    //시작날짜가 이전날짜보다 크고
                    //끝날짜가 dictionary end데이트보다 작다면
                    //데이트 추가
                    if (DateTime.Compare(DateTime.ParseExact(x.startDate,"yyyyMMddHHmmss"null), prevDate) > 0
                        && DateTime.Compare(DateTime.ParseExact(x.endDate"yyyyMMddHHmmss"null), CurrnetDate) < 0)
                    {
                        //
                        if (x.table_name == "TB_FUEL_KPI_MODEL")
                        {
                            item.Value.Gas_A = x.Gas_Flow;
                        }
                    }
                }
            }
            
        }




댓글 없음:

댓글 쓰기

git rejected error(feat. cherry-pick)

 문제 아무 생각 없이 pull을 받지않고 로컬에서 작업! 커밋, 푸시 진행을 해버렷다. push에선 remote와 다르니 당연히 pull을 진행해라고 하지만 로컬에서 작업한 내용을 백업하지 않고 진행하기에는 부담스럽다(로컬작업 유실 가능성) 해결하려...