Deepak | 2018-06-21 11:46:09 UTC | #1
Team,
I am using Analytics API (C#) to get the conversation details. In the output conversation datetime is coming in UTC. Do i need to manually convert the timezone ?
============================== var result = new List<AnalyticsConversation>(); try { var pageSize = 100; var pageNumber = 1; var api = new AnalyticsApi();
var body = new ConversationQuery { Interval = interval.ToString(), Paging = new PagingSpec(pageSize, pageNumber)
};
List<AnalyticsQueryFilter> aqfList = new List<AnalyticsQueryFilter>(); AnalyticsQueryFilter aqf = new AnalyticsQueryFilter(AnalyticsQueryFilter.TypeEnum.And);
List<AnalyticsQueryPredicate> aqpList = new List<AnalyticsQueryPredicate>(); AnalyticsQueryPredicate aqp = new AnalyticsQueryPredicate(AnalyticsQueryPredicate.TypeEnum.Dimension); aqp.Dimension = AnalyticsQueryPredicate.DimensionEnum.Purpose; aqp.Value = "acd"; aqpList.Add(aqp);
AnalyticsQueryPredicate aqp1 = new AnalyticsQueryPredicate(AnalyticsQueryPredicate.TypeEnum.Dimension); aqp1.Dimension = AnalyticsQueryPredicate.DimensionEnum.Disconnecttype; aqp1.Value = "peer"; aqpList.Add(aqp1);
aqf.Predicates = aqpList; aqfList.Add(aqf); body.SegmentFilters = aqfList;
//Log.Info($"Getting conversations for interval: {body.Interval}"); var pageResult = api.PostAnalyticsConversationsDetailsQuery(body); ==========================================================
Regards Deepak
Deepak | 2018-06-21 11:55:04 UTC | #2
Output through Analytics API (C#) Interaction start : 21/06/2018 4:03:52 AM Interaction end : 21/06/2018 4:07:42 AM
Actual data from Interaction report in purecloud Interaction Start : Thursday, June 21, 2018 8:03:52 AM Interaction end : Thursday, June 21, 2018 8:07:42 AM
tim.smith | 2018-06-21 15:53:27 UTC | #3
I believe the DateTime objects in the .NET SDK are expressed in UTC. To be sure, you can use the .ToUniversalTime() method on the object and compare the result. You can also use TimeZone.GetUtcOffset(dateTime) to retrieve the offset from an object. For your app, you will need to use the UTC object and convert to whatever timezone you wish to display.
system | 2018-07-22 15:53:29 UTC | #4
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 3050