设置浏览器时区(超过四个字母) [英] Set Browser Time zone (more than four letters)

查看:775
本文介绍了设置浏览器时区(超过四个字母)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  SET TZ = AEST -9 
c:\程序文件(x86)\ Mozilla Firefox \ firefox.exe

测试: https:// whoer .net /
。注意它是如何显示AES而不是AEST的,并且-9没有被识别。



不确定是否有解决方法,您可以更改操作系统通过浏览器的时间是惊人的。但我想我会问,有没有人得到解决这个问题?



如果我把 UTC -9 会工作,但我测试的单词超过3个字母。

解决方案

一些事情:




SET TZ=AEST -9
"c:\Program Files (x86)\Mozilla Firefox\firefox.exe"

Test against: https://whoer.net/ . Notice how it displays AES and not AEST and the -9 does not get recognized.

Not really sure if there is a workaround for this and the fact you can change your OS time through your browser is amazing. But thought I'd ask, has anyone gotten around this issue?

If I put in UTC -9 that would work but I'm testing for words above 3 letters.

解决方案

A few things:

  • The TZ variable must meet the POSIX time zone specification, of the first or second formats described here. The space in your string makes the identifier invalid.
  • AEST is typically used for Australian Eastern Standard Time, which is UTC+10, not UTC+9.

    • As the POSIX form has the sign inverted, you would use AEST-10 if you intended to represent the time in Queensland that is UTC+10 year-round.
    • If you meant to represent NSW (Sydney, etc.), then you need a much more complex identifier to represent the current time zone rules: AEST-10AEDT,M10.1.0,M4.1.0/3

    • In general, POSIX time zone strings should not be used in most cases. They are insufficient to work with all the time zones of the world, as they cannot represent historical changes or more than two transitions in a year. This is also discussed in the timezone tag wiki.

  • Ideally, you'd use the third format of the TZ variable, which is an IANA tzdb identifier, such as Australia/Brisbane or Australia/Sydney, however this will not work on Windows OS. You can only use this for Linux, OSX, etc.

  • In general, setting the TZ variable on Windows isn't reliable, as only certain APIs will use it at all. For example, the Windows C Run-Time Library's localtime function will use TZ variable, but the Win32 API's GetTimeZoneInformation function will not. Since one generally has no idea what the internals of the application are doing, it's not reasonable to expect the TZ variable to function in all cases. Indeed, while FireFox currently works, it may stop working with it in some future release - and it doesn't work for other browsers like Chrome and Edge.

  • There currently is no reliable way to set the time zone for a single process on Windows.

这篇关于设置浏览器时区(超过四个字母)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆