Skip to content

Instantly share code, notes, and snippets.

@pilif
Created December 5, 2018 06:37
Show Gist options
  • Save pilif/68e8206495cf181057be5166cb8c2c45 to your computer and use it in GitHub Desktop.
Save pilif/68e8206495cf181057be5166cb8c2c45 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,
zone text not null
);
insert into times (ts, zone) values ('2018-12-05 8:00', 'Europe/Zurich');
insert into times (ts, zone) values ('2018-12-05 7:00', 'UTC');
insert into times (ts, zone) values ('2018-12-05 7:00', 'Europe/Zurich');
select * from times where ts at time zone zone = '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