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

Fix: when the server has non UTC timezone, timestamps were wrong #442

Merged
merged 1 commit into from Jun 7, 2015

Conversation

arikfr
Copy link
Member

@arikfr arikfr commented Jun 3, 2015

No description provided.

@@ -272,7 +271,7 @@ def execute_query(self, query, data_source_id, metadata):
redis_connection.delete(QueryTask._job_lock_id(query_hash, data_source.id))

if not error:
query_result = models.QueryResult.store_result(data_source.id, query_hash, query, data, run_time, datetime.datetime.utcnow())
query_result = models.QueryResult.store_result(data_source.id, query_hash, query, data, run_time, utils.utcnow())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@runa this is the actual fix for the timezone issue. Until I get to properly test this and merge it in, if you want you can patch your install by editing /opt/redash/current/redash/tasks.py and changing on this line datetime.datetime.utcnow() to: datetime.datetime.now(pytz.utc) and adding import pytz at the top of the file.

arikfr added a commit that referenced this pull request Jun 7, 2015
Fix: when the server has non UTC timezone, timestamps were wrong
@arikfr arikfr merged commit c9da4be into master Jun 7, 2015
dairyo pushed a commit to KiiCorp/redash that referenced this pull request Mar 1, 2019
Fix: when the server has non UTC timezone, timestamps were wrong
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

Successfully merging this pull request may close these issues.

None yet

1 participant