Sauce Labs Customer Idea Portal

Submit an idea and make Sauce Labs even better!

time zone: add support for UTC plus or minus integer

Sauce Bindings 1.1.0.beta3


.setTimeZone(timeZone)


Eventually, I believe your plan was to support city names i.e.


.setTimeZone("Berlin")


This is great, but can I also suggest you support the standard in global software development, namely UTC plus or minus an integer. Correct examples would be:


.setTimeZone("UTC+2") // Berlin

.setTimeZone("UTC-7") // San_Francisco

.setTimeZone("UTC+10") // Sydney

.setTimeZone("UTC+8") // Singapore


This would be consistent with internationalization, and worthy of a product like Sauce Labs, which has a multinational user base.


City names have arbitrary characteristics which render them undesirable as an argument to this function: San_Francisco fails while New_York and Chicago pass. Denver works fine while Austin throws an unsupported error, and so on. This is in no way obvious or predictable.


The trouble isn't limited to American cities. Brussels works fine but Strasbourg fails; there is no logical reason why Strasbourg should fail. And if Brussels, why not Bruxelles?


So, again, UTC plus or minus integer is one consistent means that could work for any place on the earth, and is already widely understood across cultures.

  • Allen Loew
  • May 24 2021
  • Needs review
  • Attach files
  • Titus Fortner commented
    27 May 06:50pm

    Time Zone does work, both on Sauce & in Sauce Bindings!
    The problem is that most sites will determine location based on the IP address of the server loading the page.


    You can verify system time matches what was specified with this code:

    // https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
    SauceOptions options = SauceOptions.chrome().setTimeZone("Berlin").build();
    session = new SauceSession(options);
    webDriver = session.start();

    Long val = (Long) webDriver.executeScript("return new Date().getTimezoneOffset()");
    if (val > 0) {
    System.out.println("UTC - " + val/60);
    } else {
    System.out.println("UTC + " + Math.abs(val/60));
    }


    If you need to work with a site that uses IP address location, you'll likely need to use a proxy.