Genesys Cloud - Main

 View Only

Discussion Thread View
  Thread closed by the administrator, not accepting new replies.
  • 1.  Converting ISO8601 format time to integer seconds

    Posted 01-21-2025 03:58
    No replies, thread closed.
    Hello Everyone

    The DateTimeDiff function is used within Architect to calculate the conversation time.
     
    The expression within the update action for the current data is as follows

    →ToDuration(DateTimeDiff(ToDateTime(GetCurrentDateTimeUtc()), ToDateTime(Flow.StartDateTimeUtc)))
     
    The default value returned by this expression is in ISO8601 format, as in "PT1M8.946".
     
    How do I convert this to integer seconds?
    Example: PT1M8.946 → 68 seconds

    Best regards,

    #API/Integrations
    #ArchitectureandDesign

    ------------------------------
    Matsumoto Shun
    Unknown
    ------------------------------


  • 2.  RE: Converting ISO8601 format time to integer seconds
    Best Answer

    Posted 01-21-2025 07:29
    Edited by Jason Kleitz 01-21-2025 13:36
    No replies, thread closed.

    Hello Matsumoto,

    did you try with the ToInt() function? Converts a Duration to an Integer. Returns an Integer value equal to the Duration in milliseconds

    You can also simplify your formula to ToInt(DateTimeDiff(GetCurrentDateTimeUtc() ,Flow.StartDateTimeUtc)) I think.

    I hope it helps.

    Kind regards,

    Nathan



    ------------------------------
    Nathan Tossens
    ------------------------------



  • 3.  RE: Converting ISO8601 format time to integer seconds

    Posted 01-21-2025 21:53
    No replies, thread closed.


    Hello Nathan,

    Thanks for the reply.
     
    I tested with the ToInt() function and it returned the expected value. Thank you very much.
     
    I have no problem closing this question.


    ------------------------------
    Matsumoto Shun
    Unknown
    ------------------------------



  • 4.  RE: Converting ISO8601 format time to integer seconds

    Posted 01-22-2025 02:24
    No replies, thread closed.

    Glad I could help :)



    ------------------------------
    Nathan Tossens
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources