How to convert date timezone for 'now' before running query?

My database table timestamps are stored in US Pacific time, and I'm trying to create a report that will query for the last 7 full days (i.e yesterday - 6 days) of activity when it loads, and allow the viewer to manually change the start and end dates via parameters. Like this:


SELECT * FROM myTable WHERE date >= '{{start_date}}' AND date <= '{{end_date}}'

{% form %}
  type: date
  default: {{ 'now' | date: '%s' | minus: 604800 | date: '%Y-%m-%d' }}
  type: date
  default: {{ 'now' | date: '%s' | minus: 86400 | date: '%Y-%m-%d' }}
{% endform %}

The problem is that 'now' in Liquid returns the date in UTC, but I need it in Pacific time, so all of my reports are inaccurate.

Does anyone know how to get 'now' to return the date in a different time zone?


1reply Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Hi Ralph C

    Sorry for the delayed response, at your convenience please take a look at this example report. Let me know if that helps. 


Like Follow
  • Status Answered
  • 10 mths agoLast active
  • 1Replies
  • 142Views
  • 2 Following