-
Notifications
You must be signed in to change notification settings - Fork 1
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
Experiment with Postgres to find out how to convert all times to UTC #75
Comments
@jhaigh0 looks promising! |
Possible test/solution, try writing a script of SQL commands that you can run with
|
@jhaigh0: thanks for looking into this. I have just run a "SELECT" command as mentioned in #73. The funny thing is, now we have (re-)set the timezone, the result is actually different. It actually looks like setting UTC fixes the queries anyway:
Please see the top-panel in #73 to see how this is different to query I ran then (with TimeZone: 'Europe/London' So, the situation might be as simple as altering the column type. Please can you test that this will work if we alter the column type to remove the time zone. Hopefully it simplifies your test even more. Please document your testing here. Thanks |
This is what I've found that seems work; First set up a test table like the real data
Then remove timezone info
so we should just be able to run this alter table command on the columns that have the problem, if our end goal is to remove timezone info and just assume all is in utc. |
Thanks @jhaigh0, that looks great. |
At present, the global timezone change to UTC seems to have fixed the issue that was raised by the CDS Team. I have asked them if we should completely remove the timezone from the returned data. I would propose that that would be the best option, for simplicity and future usage. |
No further action needed on this. |
In the current r2.0 contents of the GLAMOD DB, we have some strange date/times that include a time zone. Where they have been read in by Pandas they were somehow modified. This relates to:
#73
What we need to do with the existing Postgres content is:
timestamp with timezone
totimestamp without timezone
(https://www.postgresql.org/docs/11/datatype-datetime.html)@jhaigh0 Please can you create you own test Postgres DB and create a simple table with a single column
date_time
- populate it with some values and then do some googling and testing to find out the best way for us to do the datetime conversion so that we end up removing the timezone using a simple column type:timestamp without timezone
Thanks
The text was updated successfully, but these errors were encountered: