From 3cf71e45dbbda6c96fd3ab7f9789d274b717981a Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Tue, 16 Jun 2015 08:43:21 -0500 Subject: [PATCH] Add Configure The Timezone as a postgres til. --- README.md | 1 + postgres/configure-the-timezone.md | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 postgres/configure-the-timezone.md diff --git a/README.md b/README.md index 97c8544..62caf8b 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ smart people at [Hashrocket](http://hashrocket.com/). ### postgres +- [Configure The Timezone](postgres/configure-the-timezone.md) - [Count Records By Type](postgres/count-records-by-type.md) - [Extracting Nested JSON Data](postgres/extracting-nested-json-data.md) - [Timestamp Functions](postgres/timestamp-functions.md) diff --git a/postgres/configure-the-timezone.md b/postgres/configure-the-timezone.md new file mode 100644 index 0000000..d1921d0 --- /dev/null +++ b/postgres/configure-the-timezone.md @@ -0,0 +1,20 @@ +# Configure The Timezone + +Running `show timezone;` will reveal the timezone for your postgres +connection. If you want to change the timezone for the duration of the +connection, you can run something like + +``` +> set timezone='America/New_York'; +SET +> show timezone; + TimeZone +------------------ + America/New_York +(1 row) +``` + +Now, if you run a command such as `select now();`, the time will be in +Eastern time. + +h/t Jack Christensen