Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timezone aware macro similar to now() #103

Open
msardana94 opened this issue Jul 17, 2023 · 0 comments
Open

Timezone aware macro similar to now() #103

msardana94 opened this issue Jul 17, 2023 · 0 comments

Comments

@msardana94
Copy link

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 %}
@msardana94 msardana94 changed the title [Feature Request] Timezone aware macro similar to now() Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant