convert函数 Convert函数
今天小华来给大家分享一些关于Convert函数方面的知识吧,希望大家会喜欢哦
1、14 114 dd mon yyyy hh:mi:ss:mmm(24h)to_char() 远比SQL SERVER的那个convert 方便多了。
2、to_char(timestamp, text)Pattern DescriptionHH12 hour of day (01-12)HH24 hour of day (00-23)MI minute (00-59)SS second (00-59)MS millisecond (000-999)US microsecond (000000-999999)SSSS seconds past midnight (0-86399)AM, am, PM or pm meridiem indicator (without periods)Y,YYY year (4 and more digits) with commaYYYY year (4 and more digits)YYY last 3 digits of yearYY last 2 digits of yearIYYY ISO year (4 and more digits)IYY last 3 digits of ISO yearI last digit of ISO yearBC, bc, AD or ad era indicator (without periods)B.C., b.c., A.D. or a.d. era indicator (with periods)MONTH full uppercase month name (blank-padded to 9 chars)Month full capitalized month name (blank-padded to 9 chars)month full lowercase month name (blank-padded to 9 chars)MON abbreviated uppercase month name (3 chars in English, localized lengths vary)Mon abbreviated capitalized month name (3 chars in English, localized lengths vary)MM month number (01-12)DAY full uppercase day name (blank-padded to 9 chars)Day full capitalized day name (blank-padded to 9 chars)day full lowercase daJ Julian Day (days since November 24, 4714 BC at midnight)y name (blank-padded to 9 chars)DY abbreviated uppercase day name (3 chars in English, localized lengths vary)Dy abbreviated capitalized day name (3 chars in English, localized lengths vary)dy abbreviated lowercase day name (3 chars in English, localized lengths vary)DDD day of year (001-366)IDDD ISO day of year (001-371; day 1 of the year is Monday of the first ISO week.)DD day of month (01-31)D day of the week, Sunday(1) to Saturday(7)ID ISO day of the week, Monday(1) to Sunday(7)W week of month (1-5) (The first week starts on the first day of the month.)WW week number of year (1-53) (The first week starts on the first day of the year.)IW ISO week number of year (01 - 53; the first Thursday of the new year is in week 1.)CC century (2 digits) (The twenty-first century starts on 2001-01-01.)Q quarterRM month in uppercase Roman numerals (I-XII; I=January)rm month in lowercase Roman numerals (i-xii; i=January)TZ uppercase time-zone nametz lowercase time-zone nameto_char(date 'YY-MM-DD')。
本文到这结束,希望上面文章对大家有所帮助。
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系 836084111@qq.com 删除。