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

Improve timezone handling: #617

Merged
merged 1 commit into from
Oct 20, 2015
Merged

Improve timezone handling: #617

merged 1 commit into from
Oct 20, 2015

Conversation

arikfr
Copy link
Member

@arikfr arikfr commented Oct 20, 2015

  1. Load all date/datetime values with moment.utc() instead of moment(), which was assuming user's local timezone when time zone information wasn't available.
  2. Don't use toLocaleString to format strings (which was converting them to current timezone as well). Due to the need to allow showing dates with different formatting (DD/MM vs. MM/DD), there is a new setting to define the date format.

Ideally we should add a setting to the user's profile to allow him to select his default timezone and date/time format, which we can than use when showing timestamps.

Closes #411.

1. Load all date/datetime values with moment.utc() which doesn't apply
   current timezone to them.
2. Don't use toLocaleString to format strings (which was converting them
   to current timezone as well).

Ref #411.
arikfr added a commit that referenced this pull request Oct 20, 2015
@arikfr arikfr merged commit 59f0994 into master Oct 20, 2015
@arikfr arikfr mentioned this pull request Oct 20, 2015
@stanhu
Copy link
Contributor

stanhu commented Oct 20, 2015

Thanks, @arikfr! This helps for those of us who configure the DB for UTC. However, if a DB is configured for a specific time zone, then the results will return in terms of that. I would think re:dash should use the adapter to determine this time zone before each DB session and store that in each query result.

@arikfr
Copy link
Member Author

arikfr commented Oct 21, 2015

@stanhu maybe instead of storing it in the query result, it should apply it to the date/time values it has in the results? (if there are any)

@stanhu
Copy link
Contributor

stanhu commented Oct 21, 2015

Good point. Normalizing to UTC internally in the query results is a good thing.

@arikfr
Copy link
Member Author

arikfr commented Oct 21, 2015

True. Although before adding more code to handle this, I would start with documenting that re:dash expects timestamps with either timezone data, or it assumes the data is UTC. And of course to implement #618.

@arikfr arikfr deleted the fix/timezone branch February 29, 2016 13:14
dairyo pushed a commit to KiiCorp/redash that referenced this pull request Mar 1, 2019
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.

2 participants