株式会社ヴァンデミックシステム

Blog

<スポンサーリンク>

# Postgres自体のタイムゾーン確認
root=# show timezone;
 TimeZone
----------
 Etc/UTC
(1 row)

root=# select current_timestamp;
       current_timestamp
-------------------------------
 2021-02-13 21:37:32.998281+09
(1 row)

# タイムゾーン変更
root=# Set timezone TO 'Asia/Tokyo';
SET
root=# show timezone;
  TimeZone
------------
 Asia/Tokyo
(1 row)

root=#


# データベース単位での変更もできる
root=# ALTER DATABASE "testdb" SET timezone TO 'Asia/Tokyo';
ALTER DATABASE

<スポンサーリンク>

コメントを残す

Allowed tags:  you may use these HTML tags and attributes: <a href="">, <strong>, <em>, <h1>, <h2>, <h3>
Please note:  all comments go through moderation.

*

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)