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

Audit timezone implementation #112

Open
jackfrancis opened this issue May 4, 2016 · 3 comments
Open

Audit timezone implementation #112

jackfrancis opened this issue May 4, 2016 · 3 comments

Comments

@jackfrancis
Copy link
Member

We expect all timestamps to be represented in PDT. Ensure that this is so.

@arschles
Copy link
Member

arschles commented May 4, 2016

Using the /clusters/age endpoint as an example, a URL like this:

https://versions.deis.com/v2/clusters/age?created_before=2016-12-31T00%3A00%3A00Z&created_after=2016-05-04T02%3A00%3A00Z&checked_in_before=2016-12-31T00%3A00%3A00Z&checked_in_after=2016-05-03T00%3A00%3A00Z

Means that the server will receive a timestamp formatted as RFC3339. Such a timestamp looks like 2006-01-02T15:04:05Z07:00 (omitting the URL escaped chars), and the server will parse that into a *time.Time, which contains all timezone information.

However, as of this writing, the database does not store timezone information (see http://www.postgresql.org/docs/9.1/static/datatype-datetime.html), so for those querying it, it must be assumed that all times in the DB are in UTC (since we're also formatting times as RFC3339).

We should reconfigure the DB to store timestamps as UTC in order to preserve timezones.

@arschles
Copy link
Member

arschles commented May 6, 2016

See mattn/go-sqlite3#42 for some more background, sqlite specific

@arschles
Copy link
Member

arschles commented May 6, 2016

Also see https://groups.google.com/forum/#!topic/golang-nuts/4ebvN6Bgv3M for more general background

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants