Legacy Dev Forum Posts

 View Only

Sign Up

  • 1.  Day Light Saving

    Posted 06-05-2025 18:17

    Abhijeet | 2020-04-14 02:42:54 UTC | #1

    Hi Team,

    If I read the UTC time data with timeZone as "EST" parameter, then will it handle the Day light saving settings automatically? or we need to do build the logic for Day light saving impact.

    Also, How to get the User Status data in EST time zone.

    Thanks,

    Abhijeet


    tim.smith | 2020-04-14 12:49:18 UTC | #2

    Abhijeet, post:1, topic:7531
    If I read the UTC time data with timeZone as "EST" parameter, then will it handle the Day light saving settings automatically? or we need to do build the logic for Day light saving impact.

    Can you provide some context? Where are you getting UTC time data? Where are you using the EST parameter? What are you expecting to handle daylight savings?

    Abhijeet, post:1, topic:7531
    Also, How to get the User Status data in EST time zone.

    All API resources return datetimes in UTC unless otherwise documented or indicated in the timestamp.


    Abhijeet | 2020-04-15 09:49:56 UTC | #3

    Hi tim,

    I am using below endpoint api/v2/analytics/conversations/aggregates/query

    This endpoint returns the time interval in UTC time zone. So I used below parameter given in the documentation for this end point, "timeZone":"EST"

    Now we are getting the time interval data converted into EST time Zone. So the question here is, is the API endpoint is taking care of Day light savings time table in a year while converting the data into EST timezone from UTC time zone.

    Thanks,

    Abhijeet Hivarkar


    tim.smith | 2020-04-15 13:05:22 UTC | #4

    is the API endpoint is taking care of Day light savings time

    When converting from UTC to a different timezone, yes. But keep in mind that now your application also has to take DST into account when doing all date calculations as well.


    Abhijeet | 2020-04-15 13:17:59 UTC | #5

    How I can check that my application also taking DST into account?


    tim.smith | 2020-04-15 13:21:44 UTC | #6

    You'll have to review the code you wrote and determine if it handles calculations crossing the DST boundary correctly.


    Abhijeet | 2020-04-15 13:24:05 UTC | #7

    So you mean to say even if i used the timeZone paramter , still i need to validate the data with tool dashboard as per est time?


    tim.smith | 2020-04-15 13:25:52 UTC | #8

    No, if you're doing date calculations, you need to take DST into consideration since you're using a timezone that's not UTC. If all you're doing is displaying the string returned in the data, you're not doing any date calculations.


    Abhijeet | 2020-04-15 14:53:21 UTC | #9

    Hi Tim,

    I am not doing any date calculations . I just want to display the value as is.

    I was just going though the documentation and I came to know that I need to use EDT instead of EST to impose day light saving mechanism in the interval field. So when i changed the parameter value from EST to EDT for conversation aggregate endpoint it gave me below error,

    {'message': 'The request could not be understood by the server due to malformed syntax.', 'code': 'bad.request', 'status': 400, 'contextId': '05b02d88-fa42-4af9-9fd9-3bc9c1c0814f', 'details': [], 'errors': []}

    Thanks,

    Abhijeet Hivarkar


    tim.smith | 2020-04-15 16:03:21 UTC | #10

    Take note of the description for the timeZone property on POST /api/v2/analytics/conversations/aggregates/query (emphasis added):

    Sets the time zone for the query interval, defaults to UTC. Time zones are represented as a string of the zone name as found in the IANA time zone database. For example: UTC, Etc/UTC, or Europe/London.

    EDT is not a timezone in the database because the application of daylight savings time is a function of the combination of the timezone and the specific timestamp in question, not a unique timezone. Also note that EST as an identifier is deprecated; use a regionally appropriate TZ database name for your location: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones


    system | 2020-05-16 16:03:21 UTC | #11

    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: 7531