calogica/dbt-date

Timezone aware macro similar to now()

msardana94 opened this issue · 0 comments

Is your feature request related to a problem? Please describe.
We keep audit fields (such as created_at) in some of our tables which is the data upsert time and needs to be timezone aware. I was looking to use dbt-date package instead of our internal custom macros for simplicity of our code base. The macro {{ dbt_date.now() }} returns timezone naive timestamp where as I am looking for a timezone aware field.

Describe the solution you'd like
I am not sure if there should be a new macro something like now_tz or have the ability for timezone aware response in {{ dbt_date.now() }} itself.

Describe alternatives you've considered
A simple macro that we currently use looks something like this (applicable only for snowflake db):

  '{{ tz }}', CURRENT_TIMESTAMP
){% endmacro %}