날자/시간 형식
날자/시간 형식은 특정한 문자열 패턴으로 표현된다. 패턴에 사용되는 문자는 다음과 같다.
날자/시간 패턴 문자
|
설명 |
CC
|
Century
|
| SCC |
Century BC prefixed with - |
| YYYY |
Year with 4 numbers |
| SYYY |
Year BC prefixed with - |
| IYYY |
ISO Year with 4 numbers |
| YY |
Year with 2 numbers |
| RR |
Year with 2 numbers with Y2k compatibility |
| YEAR |
Year in characters |
| SYEAR |
Year in characters, BC prefixed with - |
| BC |
BC/AD Indicator * |
Q
|
Quarter in numbers (1,2,3,4) |
| MM |
Month of year 01, 02...12 |
| MONTH |
Month in characters (i.e. January) |
| MON |
JAN, FEB |
| WW |
Weeknumber (i.e. 1) |
| W |
Weeknumber of the month (i.e. 5) |
| IW |
Weeknumber of the year in ISO standard. |
| DDD |
Day of year in numbers (i.e. 365) |
| DD |
Day of the month in numbers (i.e. 28) |
| D |
Day of week in numbers(i.e. 7) |
| DAY |
Day of the week in characters (i.e. Monday) |
| FMDAY |
Day of the week in characters (i.e. Monday) |
| DY |
Day of the week in short character description (i.e. SUN) |
| J |
Julian Day (number of days since January 1 4713 BC, where January 1 4713 BC is 1 in Oracle) |
| HH |
Hournumber of the day (1-12) |
| HH12 |
Hournumber of the day (1-12) |
| HH24 |
Hournumber of the day with 24Hours notation (1-24) |
| AM |
AM or PM |
| PM |
AM or PM |
| MI |
Number of minutes (i.e. 59) |
| SS |
Number of seconds (i.e. 59) |
| SSSSS |
Number of seconds this day. |
to_date
to_Date(date_string, date_format)
- 문자열인 date_string을 지정된 날자/시간 패턴을 사용하여 date 타입으로 변환한다.
- Parameters:
date_string - 지정된 날자/시간 형식에 일치하는 date 문자열.date_format
- 변환에 사용할 날자/시간 형식.
- Returns:
- 변환된 date 타입 변수