---
title: "ORA-01849: hour must be between 1 and 12"
author: "e_e"
date: "2016-08-05T15:07:41Z"
tags: []
categories: ["数据库"]
slug: "ora-01849-hour-must-be-between-1-and-12"
draft: false
lastmod: "2016-08-05T15:07:41Z"
id: 2315783
url: "https://e-e.iteye.com/blog/2315783"
---

《oracle 就是矫情》

 

ORA-01849: hour must be between 1 and 12

错误：

select * from SCORE\_ORDER t where app\_create\_time between to\_date('2016/08/04 00:00:00','yyyy/MM/dd HH:mi:ss') and to\_date('2016/08/04 23:00:00','yyyy/MM/dd HH:mi:ss')

更正：

select * from SCORE\_ORDER t where app\_create\_time between to\_date('2016/08/04 00:00:00','yyyy/MM/dd HH24:mi:ss') and to\_date('2016/08/04 23:00:00','yyyy/MM/dd HH24:mi:ss')

 

=========================

HH --     Hour of day (1-12).  
HH12 -- Hour of day (1-12).  
HH24 -- Hour of day (0-23).  
MI --  Minute (0-59).  
SS -- Second (0-59).

==================