Legacy Dev Forum Posts

 View Only

Sign Up

Calculating Agent Time on Status

  • 1.  Calculating Agent Time on Status

    Posted 06-05-2025 18:04

    grimdj | 2016-11-07 18:26:47 UTC | #1

    Hi,

    I'm trying to calculate the agents time on status by getting the start time (Users API [GetUserIDRoutingStatus]) and subtracting that from the current time. Is the start time stored according to the users time zone or is the time zone static for all times returned in the API?

    Thanks


    tim.smith | 2016-11-07 18:53:21 UTC | #2

    The startTime property is documented as an ISO-8601 timestamp. The spec includes timezone information in the format: https://en.wikipedia.org/wiki/ISO_8601#Time_zone_designators.

    The .NET SDK will consider this timezone when it parses the string into the DateTime object. .NET doesn't expose timezones directly in a property, but the DateTime class does provide methods ToLocalTime() to get the time in the same timezone as the current context (local PC) and ToUniversalTime() to get the time in UTC. To determine if a DateTime object is in local time or UTC, use the Kind property on the DateTime object. The .NET TimeZoneInfo class can be used to apply timezone transformations if that's necessary.


    anon47305574 | 2016-11-16 18:04:19 UTC | #3

    On this subject, you might also find these endpoints useful: https://developer.mypurecloud.com/api/rest/v2/analytics/user_detail.html

    and

    https://developer.mypurecloud.com/api/rest/v2/analytics/user_observation.html


    system | 2017-08-28 19:28:29 UTC | #4


    This post was migrated from the old Developer Forum.

    ref: 586