Skip to content

Instantly share code, notes, and snippets.

@pilif
Last active December 5, 2018 06:51
Show Gist options
  • Save pilif/3556dc45695486de8c74ecdab22e159a to your computer and use it in GitHub Desktop.
Save pilif/3556dc45695486de8c74ecdab22e159a to your computer and use it in GitHub Desktop.
create table times (
id bigserial not null primary key,
ts timestamp without time zone not null,
z text not null
);
insert into times (ts, z) values ('2018-12-05 8:00', 'Europe/Zurich');
insert into times (ts, z) values ('2018-12-05 7:00', 'UTC');
insert into times (ts, z) values ('2018-12-05 7:00', 'Europe/Zurich');
select * from times where ts at time zone z = '2018-12-05 8:00 Europe/Zurich';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment