<bdo id='4tUks'></bdo><ul id='4tUks'></ul>
  • <i id='4tUks'><tr id='4tUks'><dt id='4tUks'><q id='4tUks'><span id='4tUks'><b id='4tUks'><form id='4tUks'><ins id='4tUks'></ins><ul id='4tUks'></ul><sub id='4tUks'></sub></form><legend id='4tUks'></legend><bdo id='4tUks'><pre id='4tUks'><center id='4tUks'></center></pre></bdo></b><th id='4tUks'></th></span></q></dt></tr></i><div id='4tUks'><tfoot id='4tUks'></tfoot><dl id='4tUks'><fieldset id='4tUks'></fieldset></dl></div>

    <legend id='4tUks'><style id='4tUks'><dir id='4tUks'><q id='4tUks'></q></dir></style></legend>

    1. <tfoot id='4tUks'></tfoot>

        <small id='4tUks'></small><noframes id='4tUks'>

        oracle 格式化日期

        时间:2023-09-20
        • <i id='JdTze'><tr id='JdTze'><dt id='JdTze'><q id='JdTze'><span id='JdTze'><b id='JdTze'><form id='JdTze'><ins id='JdTze'></ins><ul id='JdTze'></ul><sub id='JdTze'></sub></form><legend id='JdTze'></legend><bdo id='JdTze'><pre id='JdTze'><center id='JdTze'></center></pre></bdo></b><th id='JdTze'></th></span></q></dt></tr></i><div id='JdTze'><tfoot id='JdTze'></tfoot><dl id='JdTze'><fieldset id='JdTze'></fieldset></dl></div>

          <small id='JdTze'></small><noframes id='JdTze'>

            1. <legend id='JdTze'><style id='JdTze'><dir id='JdTze'><q id='JdTze'></q></dir></style></legend>
                <tbody id='JdTze'></tbody>
              <tfoot id='JdTze'></tfoot>

                <bdo id='JdTze'></bdo><ul id='JdTze'></ul>
                • 本文介绍了oracle 格式化日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在包含 dd-MMM-yy 格式的日期的表中有一个日期字段.

                  I have a date field in a table that contains date in dd-MMM-yy format .

                  我想创建一个函数,让这个日期检查它是否为空,然后将其更改为 yyyy/mm/dd 格式

                  I want to create a function that get this date check it for not null and then change it to yyyy/mm/dd format

                  但问题是 oracle 不接受 dd-MMM-yy 格式日期作为输入参数和它说:请使用 yyyy-MM-dd 日期格式!!!

                  but the problem is that oracle doesn't accept dd-MMM-yy formate date as a input parameter and it say : Please Use yyyy-MM-dd date format !!!

                  我如何首先将 dd-MMM-yy 格式更改为 yyyy-MM-dd,以便 oracle 接受它作为输入然后将其更改为 yyyy/mm/dd

                  how can I first change dd-MMM-yy formate to yyyy-MM-dd so oracle accept it as input then change it to yyyy/mm/dd

                  推荐答案

                  : 请使用 yyyy-MM-dd 日期格式!!!

                  : Please Use yyyy-MM-dd date format !!!

                  这与 Oracle 错误无关.

                  That is no way related to an Oracle error.

                  我在包含 dd-MMM-yy 格式的日期的表中有一个日期字段.

                  I have a date field in a table that contains date in dd-MMM-yy format .

                  不,你很困惑.Oracle 不会以您看到的格式存储日期.它在内部以 7 个字节存储它,每个字节存储日期时间值的不同组成部分.

                  No, you are confused. Oracle does not store dates in the format you see. It stores it internally in 7 bytes with each byte storing different components of the datetime value.

                  Byte    Description
                  ----    -------------------------------------------------
                  1       Century value but before storing it add 100 to it
                  2       Year and 100 is added to it before storing
                  3       Month
                  4       Day of the month
                  5       Hours but add 1 before storing it
                  6       Minutes but add 1 before storing it
                  7       Seconds but add 1 before storing it
                  

                  如果要显示,请使用TO_CHAR和适当的FORMAT MODEL.

                  If you want to display, use TO_CHAR with proper FORMAT MODEL.

                  插入时,使用TO_DATE和适当的FORMAT MODEL.

                  While inserting, use TO_DATE with proper FORMAT MODEL.

                  默认情况下,您看到的格式是您的特定于区域设置的 NLS 设置.

                  What you see as a format by default, is your locale specific NLS settings.

                  SQL> select parameter, value from v$nls_parameters where parameter='NLS_DATE_FORMAT';
                  
                  PARAMETER       VALUE
                  --------------- ----------------------------------------------------------------
                  NLS_DATE_FORMAT DD-MON-RR
                  
                  SQL> select sysdate from dual;
                  
                  SYSDATE
                  ---------
                  03-FEB-15
                  
                  SQL> select to_char(sysdate, 'mm/dd/yyyy hh24:mi:ss') from dual;
                  
                  TO_CHAR(SYSDATE,'MM
                  -------------------
                  02/03/2015 17:59:42
                  
                  SQL>
                  

                  更新关于MMM格式.

                  对于 MMM,如果您指的是最多三个字符的月份名称,请使用 MON.

                  By MMM if you mean the month name up to three characters, then use MON.

                  这篇关于oracle 格式化日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Oracle SQL - 确定连续值范围 下一篇:如何在oracle中显示用户的所有权限?

                  相关文章

                  <legend id='JETir'><style id='JETir'><dir id='JETir'><q id='JETir'></q></dir></style></legend>
                • <tfoot id='JETir'></tfoot>
                  • <bdo id='JETir'></bdo><ul id='JETir'></ul>

                  <small id='JETir'></small><noframes id='JETir'>

                    1. <i id='JETir'><tr id='JETir'><dt id='JETir'><q id='JETir'><span id='JETir'><b id='JETir'><form id='JETir'><ins id='JETir'></ins><ul id='JETir'></ul><sub id='JETir'></sub></form><legend id='JETir'></legend><bdo id='JETir'><pre id='JETir'><center id='JETir'></center></pre></bdo></b><th id='JETir'></th></span></q></dt></tr></i><div id='JETir'><tfoot id='JETir'></tfoot><dl id='JETir'><fieldset id='JETir'></fieldset></dl></div>