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

setting a time zone for default time stamps #753

Closed
Tracked by #138
scottywm opened this issue Jul 30, 2022 · 1 comment
Closed
Tracked by #138

setting a time zone for default time stamps #753

scottywm opened this issue Jul 30, 2022 · 1 comment
Assignees
Labels
question The issue's author needs more information wontfix This will not be worked on

Comments

@scottywm
Copy link

Hello, i am needing a way to set the default time stamp in my migrations table so I hav the below example where i have a column called "time_test" and its default value is the time the row is created.

create_table("users") {
t.Column("id", "bigint", {primary: true})
t.Column("user_name", "varchar(20)")
t.Column("password", "varchar")
t.Column("time_test", "timestamp", {"default": "now"})
}

i need a way to set this time zone for this column to UTC, How do I do it?

Thanks

Scott

@sio4
Copy link
Member

sio4 commented Aug 25, 2022

Actually, this is not in Buffalo's scope but Pop's. However, there were some related discussions and closed PRs for this:

https://github.com/gobuffalo/pop/issues?q=timezone

Basically, the timezone configuration is usually the scope of the database engine itself and the connector or application just uses them. If you just want to store a UTC value in a specific column, I guess you can set the value from your app or from the model's validation functions.

Please check the discussions linked above. Also, I am going to close this issue for now and will move it under Pop.

@sio4 sio4 closed this as completed Aug 25, 2022
@sio4 sio4 transferred this issue from gobuffalo/buffalo Aug 25, 2022
@sio4 sio4 added wontfix This will not be worked on question The issue's author needs more information labels Aug 25, 2022
@sio4 sio4 self-assigned this Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question The issue's author needs more information wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants