LoginSignup
17
11

More than 5 years have passed since last update.

【PostgreSQL】任意の文字列をTimestampやDateに変換する方法

Last updated at Posted at 2017-11-01

任意の文字列('2000/01/01 20:15:00')をTimestampに変換する方法

sql
TO_TIMESTAMP('2000/01/01 20:15:00', 'YYYY/MM/DD HH24:MI:SS')

任意の文字列('2000/01/01')をDateに変換する方法

sql
TO_DATE('2000/01/01', 'YYYY/MM/DD')

17
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
11