mysql相似於oracle的to_char() to_date()方法

來源:互聯網
上載者:User

標籤:ar   for   div   sp   c   時間   r   sql   bs   

mysql日期和字元相互轉換方法 date_format(date,‘%Y-%m-%d‘)    -------------->oracle中的to_char(); str_to_date(date,‘%Y-%m-%d‘)     -------------->oracle中的to_date();
%Y:代表4位的年份 %y:代表2為的年份   %m:代表月, 格式為(01……12)   %c:代表月, 格式為(1……12)   %d:代表月份中的天數,格式為(00……31)   %e:代表月份中的天數, 格式為(0……31)    %H:代表小時,格式為(00……23)   %k:代表 小時,格式為(0……23)   %h: 代表小時,格式為(01……12)   %I: 代表小時,格式為(01……12)   %l :代表小時,格式為(1……12)    %i: 代表分鐘, 格式為(00……59) 
%r:代表 時間,格式為12 小時(hh:mm:ss [AP]M)   %T:代表 時間,格式為24 小時(hh:mm:ss) 
%S:代表 秒,格式為(00……59)   %s:代表 秒,格式為(00……59) 

mysql相似於oracle的to_char() to_date()方法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.