2

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?

Community
  • 1
  • 1
Steve Nay
  • 2,819
  • 1
  • 30
  • 41

1 Answers1

1

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");
    }

  }
MEH
  • 598
  • 4
  • 11
  • That makes sense. So there's no way to get the timezone per se, but you can check if it's one that you care about (MST in this example). Is that right? – Steve Nay Dec 28 '10 at 20:12