获取用户的 KRL 时区

发布于 2024-10-09 14:49:46 字数 329 浏览 0 评论 0原文

Mike 的问题的后续问题关于在 KRL 的时间。是否可以获取用户的时区?有一个 时区谓词

time:timezone(<arg>)

但看起来它需要一个参数。我该如何使用它?

A follow-up question to Mike's question about getting the time in KRL. Is it possible to get the user's timezone? There is a timezone predicate,

time:timezone(<arg>)

but it looks like it requires an argument. How do I use that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风铃鹿 2024-10-16 14:49:46

time:timezone() 是返回 true 或 false 的谓词。

我将更正文档,但 time:timezone() 采用时区缩写并检查用户的地理位置(基于 IP 地址)并返回 true 或 false

   rule first_rule is active {
    select when pageview ".*" setting ()
    if (time:timezone("MST")) then {
      notify("Glee alert", "Glee starts at 7pm");
    }

  }

time:timezone(<arg>) is a predicate which returns true or false.

I will correct the documentation, but time:timezone() takes a timezone abbreviation and checks the user's geo-location (based upon IP address) and returns true or false

   rule first_rule is active {
    select when pageview ".*" setting ()
    if (time:timezone("MST")) then {
      notify("Glee alert", "Glee starts at 7pm");
    }

  }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文