Now() Table Calculation Function Has Better Timezone Handling (3.48+)


(Brett Sauve) #1

As of 3.48 the now() table calculation will evaluate in the user or query timezone, falling back to the application timezone when no query timezone has been set. As a reminder, this is what those different timezones mean:

  • Application Time Zone: This is the time zone that Looker uses when users schedule emails or dashboards. It gets set in Looker’s Admin page.
  • Query Time Zone: You set this when you create a database connection, but only if you have not enabled user specific time zones. It indicates the time zone that should be displayed to your users when they pull time data in Looker (i.e. Looker converts from Database Time Zone into Query Time Zone).
  • User Specific Time Zones: If you enable this feature, users can all set their own timezone. Looker will then convert from the Database Time Zone to each user’s time zone when they pull time data in Looker.

This change ensures that now() gives you the same timezone as the results you’re combining it with. This should help to avoid confusion and the general tedium that comes with managing timezones.

One thing to keep in mind is that now() might not match the time that you see on your computer if it just so happens that your Looker timezone and your computer’s timezone don’t match. This is the sort of thing that could happen if, for example, your company is based in California (and converts everything to PST) but you happen to be working from New York.