cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Public Synthetic Monitor's Timezones (AEST / Australia)

ThomasEaton
Helper

All,

I have created a 90 step synthetic, which is to create a quote. https://www.qbe.com/au/home-insurance - it is open for the world to access and generate a quote for a policy in Home or Insurance, these were the products i was looking at. 

The issue is, I am in UK (UTC+1 / GMT+1 / BST), so AEST (Australia) passes into a new day currently 9 hours ahead of me. So when i record the synthetic, i set my OS timezone to Sydney (if i do not, when we hit 3pm (GMT+1), the website 2nd page, after you hit get a quote, it auto generates the date and you can not change it, is it set to today.

I spoke to DynatraceONE, who gave me a script for changing the date to be updated 1 day ahead. But I need a script which updates it by 10 Hours. I was wondering if anyone has done this before and what people do for synthetics they want running in a specific timezone from the public locations?

Can anyone help me update the below to have 10 hours instead of 1 day (24 hours)?

Increment by a day script:

var today = new Date();
today.setDate(today.getDate()+1);
dateformat= today.getFullYear() + "-" + ("0" + (today.getMonth() + 1)).slice(-2) + "-" + ("0" + today.getDate()).slice(-2) ;

function addDays(date, numDays) {
return new Date(date.getFullYear(), date.getMonth(), date.getDate() + numDays);

}
function date_format(date)
{
var month = date.getMonth() + 1;
var twoDigitMonth = (month < 10) ? ('0' + month) : month;
var twoDigitDate = (date.getDate() < 10) ? ('0' + date.getDate()) : date.getDate();
// return (twoDigitDate + '-' + twoDigitMonth + '-' + date.getFullYear());
return (date.getFullYear() + '-' + twoDigitMonth + '-' + twoDigitDate);
}
var todayDate = new Date();
var dateTomorrow = addDays(todayDate, 1);

var dateformat = date_format(dateTomorrow);
api.info("dateformat: " + dateformat);
api.setValue("dateformat", dateformat);

6 REPLIES 6

ThomasEaton
Helper

I now realise it is java script and being a an extra 14 hours ahead will work as it is in the future and not the past, where the past was the issue. I will implement Dynatrace's code (+1 day) and see how that goes.

But i learned today that all Public Synthetic locations run in UTC and we have to edit the scripts with a java event, to add code to update the date or time.

Karolina_Linda
Community Team
Community Team

hi @ThomasEaton, one of our developers will also take a look at the case you provided. Stay tuned 🙂 

Keep calm and build Community!

HI no one ever contacted me 😞 - but we have resolved the issue.

Can you please log a documentation update to show that Public locations run in UTC - I am sure it will help others. - as i bet most people assume the public location synthetic locations run in the locations time zone.. I.E AEST for Sydney? 😞

ThomasEaton
Helper

I added as a step 2, as you can not put it as step 1, that has to be a navigation type event. It didn't work 😞

ThomasEaton
Helper

In the end, we had a solution given by a product specialist:

ThomasEaton_0-1628158876904.png


He added a DOM Element: document.querySelectorAll('button[class*="current"]')[0].parentElement.nextElementSibling


ThomasEaton
Helper

Also, Dynatrace confirmed, all public Synthetic locations are in UCT - would be good to add this to the documentation please.

Featured Posts