首页 > 数据库 >LightDB-Oracle兼容 nls_date_format、nls_timestamp_format参数

LightDB-Oracle兼容 nls_date_format、nls_timestamp_format参数

时间:2022-09-27 12:57:12浏览次数:63  
标签:case week nls name format chars day LightDB

在22.3版本以前的LightDB数据库中,存在sysdate和systimestamp两个获取当前时间参数,具体使用如下:

 而针对sysdate和systimestamp的日期输出的支持格式十分有限:

主要因为datestyle的设置格式较为固定,无法自由配置想要的结果:

 

在当前22.3版本的LightDB中,支持了在仅当Oracle兼容模式下,通过设置nls_date_format和nls_timestamp_format的格式,来支持sysdate和systimestamp的输出格式,如下:

 

 

 此时对nls_date_format和nls_timestamp_format参数进行配置:

 

 

 nls_date_format和nls_timestamp_format参数具体支持的日期格式如下:

 

 

 

 

 

 

 

 

 

 

 

PatternDescriptionHHhour of day (01–12)HH12hour of day (01–12)HH24hour of day (00–23)MIminute (00–59)SSsecond (00–59)MSmillisecond (000–999)USmicrosecond (000000–999999)FF1tenth of second (0–9)FF2hundredth of second (00–99)FF3millisecond (000–999)FF4tenth of a millisecond (0000–9999)FF5hundredth of a millisecond (00000–99999)FF6microsecond (000000–999999)SSSSSSSSSseconds past midnight (0–86399)AMamPM or pmmeridiem indicator (without periods)A.M.a.m.P.M. or p.m.meridiem indicator (with periods)Y,YYYyear (4 or more digits) with commaYYYYyear (4 or more digits)YYYlast 3 digits of yearYYlast 2 digits of yearYlast digit of yearIYYYISO 8601 week-numbering year (4 or more digits)IYYlast 3 digits of ISO 8601 week-numbering yearIYlast 2 digits of ISO 8601 week-numbering yearIlast digit of ISO 8601 week-numbering yearBCbcAD or adera indicator (without periods)B.C.b.c.A.D. or a.d.era indicator (with periods)MONTHfull upper case month name (blank-padded to 9 chars)Monthfull capitalized month name (blank-padded to 9 chars)monthfull lower case month name (blank-padded to 9 chars)MONabbreviated upper case month name (3 chars in English, localized lengths vary)Monabbreviated capitalized month name (3 chars in English, localized lengths vary)monabbreviated lower case month name (3 chars in English, localized lengths vary)MMmonth number (01–12)DAYfull upper case day name (blank-padded to 9 chars)Dayfull capitalized day name (blank-padded to 9 chars)dayfull lower case day name (blank-padded to 9 chars)DYabbreviated upper case day name (3 chars in English, localized lengths vary)Dyabbreviated capitalized day name (3 chars in English, localized lengths vary)dyabbreviated lower case day name (3 chars in English, localized lengths vary)DDDday of year (001–366)IDDDday of ISO 8601 week-numbering year (001–371; day 1 of the year is Monday of the first ISO week)DDday of month (01–31)Dday of the week, Sunday (1) to Saturday (7)IDISO 8601 day of the week, Monday (1) to Sunday (7)Wweek of month (1–5) (the first week starts on the first day of the month)WWweek number of year (1–53) (the first week starts on the first day of the year)IWweek number of ISO 8601 week-numbering year (01–53; the first Thursday of the year is in week 1)CCcentury (2 digits) (the twenty-first century starts on 2001-01-01)JJulian Date (integer days since November 24, 4714 BC at local midnight; see Section B.7)QquarterRMmonth in upper case Roman numerals (I–XII; I=January)rmmonth in lower case Roman numerals (i–xii; i=January)TZupper case time-zone abbreviationtzlower case time-zone abbreviationTZHtime-zone hoursTZMtime-zone minutesOFtime-zone offset from UTC

标签:case,week,nls,name,format,chars,day,LightDB
From: https://www.cnblogs.com/xxl-cr7/p/16734168.html

相关文章