cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
539
Views
0
Helpful
1
Replies

How to obtain local time on Webex Connect using the Evaluate Node?

Gerry O'Rourke
Spotlight
Spotlight

The following does NOT convert the time from UTC (GMT) Time to UK Time as expected.

 

startTime = new Date();
startTimeISO = startTime.toISOString();

localTime = new Date(startTime).toLocaleString('en-GB', {timeZone: 'Europe/London'})
1;

 

Returns the following:

 

{
    "_nodetid": "61225e66-2e1d-1b9d-2411-28e8a38d708d",
    "startTime": "org.mozilla.javascript.NativeDate@26c7f62d",
    "startTimeISO": "2023-08-02T12:34:37.738Z",
    "localTime": "August 2, 2023 12:34:37 PM GMT",
    "_wferrordesc": "",
    "_wferrorstatus": "",
    "_wfnoderesult": "1",
    "transid": "064f0b44-ac1e-8d46-41cd-015e6dc5949e"
}

 

Note the localTime variable is set to the SAME time as UTC - i.e. 12:34:37 and NOT 13:34:37 as expected.

Any ideas on how to generate local time using the evaluate node on the Webex Connect Platform?

i.e. by local time in this instance the TimeZone - Europe/London ?

Regards,

Gerry

1 Reply 1

mparra.fusionet
Level 1
Level 1

#1 a big fan of every banana has 5 sides , I have read your website for several years as a guidance for CC stuff!

 

#2 I had a similar problem, ended up setting up a lambda function in AWS with a pretty basic api, to get operations with dates, it might give you more control, but is not a native solution like the Java script you are using