You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "chenyunren (JIRA)" <ji...@apache.org> on 2018/07/12 02:37:00 UTC

[jira] [Resolved] (TRAFODION-3127) to_char enhancement

     [ https://issues.apache.org/jira/browse/TRAFODION-3127?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

chenyunren resolved TRAFODION-3127.
-----------------------------------
    Resolution: Fixed

> to_char enhancement
> -------------------
>
>                 Key: TRAFODION-3127
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-3127
>             Project: Apache Trafodion
>          Issue Type: Improvement
>            Reporter: chenyunren
>            Assignee: chenyunren
>            Priority: Major
>
> |Pattern|Description|EXP.|
> |HH|  hour of day (00-23)|TO_CHAR (TIME '23:05:10','HH')
>  result:23|
> |HH12|  hour of day (01-12)|TO_CHAR (TIME '23:05:10','HH')
>  result:11|
> |HH24|hour of day (00-23)|TO_CHAR (TIME '23:05:10','HH')
>  result:23|
> |MI|minute (00-59)|TO_CHAR (TIME '23:05:10','MI')
>  result:05|
> |SS|second (00-59)|TO_CHAR (TIME '23:05:10','SS')
>  result:10|
> |YYYY|year (4  digits)|TO_CHAR (TIMESTAMP '2016-03-01 12:05:10','YYYY')
>  result:2016|
> |Y|Last digit of the year (0-9)| TO_CHAR (TIMESTAMP '2016-03-01 12:05:10','Y')
>  result:6|
> |YY|Last two digits of the year (00-99)| TO_CHAR (TIMESTAMP '2016-03-01 12:05:10','YY')
>  result:16|
> |YYY|Last three digits of the year (000-999)| TO_CHAR (TIMESTAMP '2016-03-01 12:05:10','YYY')
>  result:016|
> |MON|month(3 chars in English)|TO_CHAR (TIMESTAMP '2016-03-01 12:05:10','MON')
>  result:MAR|
> |MM|month(01-12)|TO_CHAR(DATE '2006-12-01','MM')
>  result:12|
> |DY|name of day(3 chars in English) |TO_CHAR (TIMESTAMP '2016-03-01 12:05:10','DY')
>  result:TUE|
> |DAY|Name of day, padded with blanks to length of 9 characters. SUNDAY|TO_CHAR (TIMESTAMP '2016-03-01 12:05:10','DY')
> result:TUESDAY|
> |CC|century|TO_CHAR (TIMESTAMP '2016-03-01 12:05:10','CC')
>  result:21|
> |D|day of week(Sunday (1) to Saturday (7))|TO_CHAR (TIMESTAMP '2016-03-01 12:05:10','D')
>  result:3|
> |DD|day of month(01-31)|TO_CHAR(DATE '2006-12-01','DD')
>  result:01|
> |DDD|day of year(1-366)|TO_CHAR(DATE '2006-12-01','DDD')
>  result:335|
> |W|week of month(1-5)|TO_CHAR(DATE '2006-12-31','W')
>  result:5|
> |WW|week number of year(1-53).The first week starts on the first day of the month.|TO_CHAR(DATE '2006-01-02','WW')
>  result:01|
> |J|Julian day (number of days since January 1, 4713 BC)|TO_CHAR(TIMESTAMP '2001-01-07 00:00:00','J')
>  result:2451917|
> |Q|The quarter of the year (1 - 4)|TO_CHAR(DATE '2006-12-01','Q')
>  result:4|



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)