Im trying to get the current time in Europe/London time zone using K6.
const date = new Date();
console.log(
date.toLocaleString('en-GB', {
timeZone: 'Europe/London',
}),
);
But it looks like it ignores the locale and gives me my machine timezone date and time.
This is what is mentioned in the implementation document of K6
The toLocaleDateString() method returns a string with a language sensitive representation of the date portion of this date. The new locales and options arguments let applications specify the language whose formatting conventions should be used and allow to customize the behavior of the function. In older implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation dependent.