1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-02 22:58:01 +00:00

Add Configure The Timezone as a postgres til.

This commit is contained in:
jbranchaud
2015-06-16 08:43:21 -05:00
parent 1216ba28af
commit 3cf71e45db
2 changed files with 21 additions and 0 deletions

View File

@@ -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)

View File

@@ -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