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.
------------------------------
Original Message:
Sent: 07-18-2024 10:02
From: David Fradejas Tomás
Subject: GenesysCloud Scripting dateToMilliseconds function locale problem
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.
Original Message:
Sent: 07-18-2024 09:57
From: Paul Simpson
Subject: GenesysCloud Scripting dateToMilliseconds function locale problem
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.
Original Message:
Sent: 07-18-2024 09:42
From: David Fradejas Tomás
Subject: GenesysCloud Scripting dateToMilliseconds function locale problem
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.
Original Message:
Sent: 07-18-2024 09:32
From: Paul Simpson
Subject: GenesysCloud Scripting dateToMilliseconds function locale problem
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.
Original Message:
Sent: 03-04-2024 04:42
From: David Fradejas Tomás
Subject: GenesysCloud Scripting dateToMilliseconds function locale problem
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:
English:
#Implementation
#Platform Administration
------------------------------
David Fradejas Tomás
Sabio Ibérica, S.A.
------------------------------