Genesys Cloud - Main

 View Only

Discussion Thread View
  • 1.  GenesysCloud Scripting dateToMilliseconds function locale problem

    Posted 03-04-2024 04:43

    Good morning experts,
    while implementing a script, I have found that the dateToMilliseconds function returns a different data depending on the language selected by the agent. In the image you can see the difference between a date in Spanish language, versus English, so it implies a different result of this function. :

    Is there any workarround we can use? thanks

    Spanish:

    image

    English:

    image


    #Implementation
    #Platform Administration

    ------------------------------
    David Fradejas Tomás
    Sabio Ibérica, S.A.
    ------------------------------


  • 2.  RE: GenesysCloud Scripting dateToMilliseconds function locale problem

    GENESYS
    Posted 07-16-2024 12:33
      |   view attached

    Hello David, 

    It would depend on the scripting logic that you are trying to run. 

    I have an example script you can try which I have implemented in the past in my environment and it worked. 

    If this doesnt work then you will need to contact Customer Care Scripting Team so they can review the script logic and provide you with more indepth troubleshooting. 

    Hope this helps!

    Cheers, 



    ------------------------------
    Cameron Tomlin
    Online Community Manager/Moderator
    Genesys - Employees
    ------------------------------

    Attachment(s)



  • 3.  RE: GenesysCloud Scripting dateToMilliseconds function locale problem

    Posted 07-18-2024 09:33

    It looks to me to be more about locale then language. Assuming you are referring to the Date portion specifically, remember in the US dates are written with month and day reversed when compared to the rest of the world (and, may I add, any sensible approach! - Let's start an indignant flame war 😜) i.e. in the US the format is mm/dd/yyyy but elsewhere it's dd/mm/yyyy. 

    So, for example, in the US today (18th July 2024) would be written 7/18/24 in the US and 18/7/24 in the rest of the civilized world.

    Looking at your examples, it would appear that this is what is happening.

    HTH



    ------------------------------
    Paul Simpson
    Views expressed are my own and do not necessarily reflect those of my employer.
    ------------------------------



  • 4.  RE: GenesysCloud Scripting dateToMilliseconds function locale problem

    Posted 07-18-2024 09:43

    Hi Paul, 

    I could reproduce the scenario, just changing my default laguage into genesys cloud UI....As you thought, anyone should be able to change their language into the UI, and this should not affect on how Scripting is implemented...so my approach arround this is that this should be corrected in GC side....



    ------------------------------
    David Fradejas Tomás
    Sabio Ibérica, S.A.
    ------------------------------



  • 5.  RE: GenesysCloud Scripting dateToMilliseconds function locale problem

    Posted 07-18-2024 09:58

    David,

    Heh, you won't get any argument from me on that one! I was just trying to offer a perspective on what exactly appears to be happening and possibly why.

    Now, as to how to deal with it, and whose responsibility that is.... 🤷‍♂️



    ------------------------------
    Paul Simpson
    Views expressed are my own and do not necessarily reflect those of my employer.
    ------------------------------



  • 6.  RE: GenesysCloud Scripting dateToMilliseconds function locale problem

    Posted 07-18-2024 10:03

    Thank you very much Paul, for the help, but it's really frustrating when things like this happen, and having to handle this kind of scenarios within the script itself, as we haven't found any other way to solve it :)



    ------------------------------
    David Fradejas Tomás
    Sabio Ibérica, S.A.
    ------------------------------



  • 7.  RE: GenesysCloud Scripting dateToMilliseconds function locale problem
    Best Answer

    Posted 07-22-2024 15:18

    David,

    OK, just spit-balling, here, so forgive me if this isn't a flyer, but it sounds to me like what you need is a way to detect if the Locale us US or non-US and then switch out which way you interpret results etc. I'm not sure if you can look at the Locale directly, BUT...

    What you COULD do is to run the function against a known data and look at the returned Months value. Say you give it the date February 1st 2024 and then looked at the second pair of numbers. If it's 01, then you know it's US format (02/01/24) but if it's 02 then it's rest of the world (01/02/24) you then have two versions of whatever processing is required to perform your logic for each scenario.

    HTH



    ------------------------------
    Paul Simpson
    Views expressed are my own and do not necessarily reflect those of my employer.
    ------------------------------



Need Help finding something?

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