0
일부 필드간에 날짜 형식이 다른 이유가 궁금했습니다.누적 기일 (Cumulocity date) 형식
이{
"time": "2016-05-30T06:00:00.000+02:00",
"id": "33200",
"self": "https://management.post-iot.lu/measurement/measurements/33200",
"source": {
"id": "26932",
"self": "https://management.post-iot.lu/inventory/managedObjects/26932"
},
"type": "ParkingSpotOccupation",
"startDate": {
"time": 1464580800000,
"minutes": 0,
"seconds": 0,
"hours": 6,
"month": 4,
"timezoneOffset": -120,
"year": 116,
"day": 1,
"date": 30
},
"duration": 600,
"endDate": {
"time": 1464581400000,
"minutes": 10,
"seconds": 0,
"hours": 6,
"month": 4,
"timezoneOffset": -120,
"year": 116,
"day": 1,
"date": 30
}
}
왜 시간과의 startDate/endDate가 다르게 렌더링 먹은 다음 API를 측정을 사용하여 다음과 같은
@Name("measurement_occupation")
context ParkingSpotOccupation
insert into CreateMeasurement
select
e.source as source,
"ParkingSpotOccupation" as type,
min(e.time) as time,
{
"startDate", min(e.time),
"endDate", max(e.time),
"duration", dateDifferenceInSec(max(e.time), min(e.time))
} as fragments
from
SmartParkingEvent e
output
last when terminated;
그리고 그 결과는 다음과 같습니다 내 규칙은 다음과 같이 선언? 다음과 같이 내 이벤트 processig 규칙의 출력이 포맷 표시 심지어 낯선 사람 :
{ "time": { "date": 30, "day": 1, "hours": 6, "minutes": 0, "month": 4, "seconds": 0, "time": 1464580800000, "timezoneOffset": -120, "year": 116 }, "source": "26932", "fragments": [ "startDate", { "date": 30, "day": 1, "hours": 6, "minutes": 0, "month": 4, "seconds": 0, "time": 1464580800000, "timezoneOffset": -120, "year": 116 }, "endDate", { "date": 30, "day": 1, "hours": 6, "minutes": 10, "month": 4, "seconds": 0, "time": 1464581400000, "timezoneOffset": -120, "year": 116 }, "duration", 600 ], "type": "ParkingSpotOccupation" }
그래서 모든 날짜가 동일하게 보이는,하지만 내가 측정에 액세스하는 API를 사용할 때. 모든 날짜를 "2016-05-30T06 : 00 : 00.000 + 02 : 00"형식으로 저장하고 싶습니다. 또한 cast (min (e.time), Date)를 사용하려고 시도했지만 오류가 발생했습니다. 'Date'라는 이름의 캐스트 함수에 나열된 클래스는로드 할 수 없습니다. 그리고 toDate() 함수를 시도했지만 아무 것도 변경하지 않았습니다.