| sitelink1 | |
|---|---|
| sitelink2 | |
| sitelink3 | |
| sitelink4 | |
| sitelink5 | |
| sitelink6 |
Example>>
/* Source **************************************************************************/
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd a HH:mm:ss");
String result = sdf.format(new java.util.Date(System.currentTimeMillis()));
System.out.println(result);
/*********************************************************************************/
/* SQL Query **************************************************************************/
select input_time from db_monitor where to_char(input_time , 'RRRR-MM-DD HH24:MI:SS') < '2003-11-08 17:52:35';
/*********************************************************************************/
/* JAVA Code **************************************************************************/
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String input_time = sdf.format(new java.util.Date(System.currentTimeMillis()));
String QUERY = INSERT INTO 테이블이름 values ( to_date( '"+ input_time +"' , 'RRRR-MM-DD HH24:MI:SS' ) );
/*********************************************************************************/
<참고>
1. 자바서비스넷 이원영씨의 관련 게시글 -> 보기
2. java.sql.Date 클래스에 다음같은 메서드도 있다.
[ public static Date valueOf(String s)
-> Converts a string in JDBC date escape format to a Date value.
Parameters:
s - a String object representing a date in in the format "yyyy-mm-dd"
Returns:
a java.sql.Date object representing the given date
Throws:
IllegalArgumentException - if the date given is not in the JDBC date escape format (yyyy-mm-dd) ]
3. java.text.SimpleDateFormat 클래스는 java.text.DateFormat 클래스에서 상속받은 다음의 메서드도 있다.
[ public Date parse(String source) throws ParseExceptionParses
-> text from the beginning of the given string to produce a date. The method may not use the entire text of the given string.
See the parse(String, ParsePosition) method for more information on date parsing.
Parameters:
source - A String whose beginning should be parsed.
Returns:
A Date parsed from the string.
Throws:
ParseException - if the beginning of the specified string cannot be parsed. ]
/* Source **************************************************************************/
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd a HH:mm:ss");
String result = sdf.format(new java.util.Date(System.currentTimeMillis()));
System.out.println(result);
/*********************************************************************************/
/* SQL Query **************************************************************************/
select input_time from db_monitor where to_char(input_time , 'RRRR-MM-DD HH24:MI:SS') < '2003-11-08 17:52:35';
/*********************************************************************************/
/* JAVA Code **************************************************************************/
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String input_time = sdf.format(new java.util.Date(System.currentTimeMillis()));
String QUERY = INSERT INTO 테이블이름 values ( to_date( '"+ input_time +"' , 'RRRR-MM-DD HH24:MI:SS' ) );
/*********************************************************************************/
<참고>
1. 자바서비스넷 이원영씨의 관련 게시글 -> 보기
2. java.sql.Date 클래스에 다음같은 메서드도 있다.
[ public static Date valueOf(String s)
-> Converts a string in JDBC date escape format to a Date value.
Parameters:
s - a String object representing a date in in the format "yyyy-mm-dd"
Returns:
a java.sql.Date object representing the given date
Throws:
IllegalArgumentException - if the date given is not in the JDBC date escape format (yyyy-mm-dd) ]
3. java.text.SimpleDateFormat 클래스는 java.text.DateFormat 클래스에서 상속받은 다음의 메서드도 있다.
[ public Date parse(String source) throws ParseExceptionParses
-> text from the beginning of the given string to produce a date. The method may not use the entire text of the given string.
See the parse(String, ParsePosition) method for more information on date parsing.
Parameters:
source - A String whose beginning should be parsed.
Returns:
A Date parsed from the string.
Throws:
ParseException - if the beginning of the specified string cannot be parsed. ]
댓글 0
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
|---|---|---|---|---|
| 46 | 서버페이지의 처리시 charset 설정 | 황제낙엽 | 2004.05.27 | 751 |
| 45 | 서버페이지 호출시 파라미터의 한글처리 | 황제낙엽 | 2004.05.27 | 563 |
| 44 | forward & sendRedirect | 황제낙엽 | 2004.03.09 | 795 |
| 43 | JDF(Java Development Framework) 관련 | 황제낙엽 | 2004.02.11 | 647 |
| » | JDBC Date 포맷 변환 | 황제낙엽 | 2003.11.08 | 1244 |
| 41 | Connection 리소스 관리시 주의해야 할 점 | 황제낙엽 | 2003.09.06 | 739 |
| 40 | XSLTFilter ... (퍼옴) | 황제낙엽 | 2003.07.21 | 788 |
| 39 | (초보탈출 II) 내부클래스 | 황제낙엽 | 2003.05.20 | 658 |
| 38 | (초보탈출 I) 패키지 | 황제낙엽 | 2003.05.20 | 687 |
| 37 | 열네번째날 (화상 채팅 프로그램 프로젝트) | 황제낙엽 | 2003.04.21 | 1184 |
| 36 | 열세번째날 - WEB APPLICATION | 황제낙엽 | 2003.04.15 | 1432 |
| 35 | 열두번째날 - I/O | 황제낙엽 | 2003.04.15 | 569 |
| 34 | 열하나째날 - 스레드 | 황제낙엽 | 2003.04.15 | 564 |
| 33 | 열번째날 - 애플릿과 그래픽 | 황제낙엽 | 2003.04.15 | 825 |
| 32 | 아홉째날 - SWING | 황제낙엽 | 2003.04.15 | 738 |
| 31 | 여덟째날 - 예외처리 | 황제낙엽 | 2003.04.14 | 725 |
| 30 | 일곱째날 - EVENT | 황제낙엽 | 2003.04.14 | 490 |
| 29 | 여섯째날 - AWT | 황제낙엽 | 2003.04.14 | 823 |
| 28 | 다섯째날 - Collection, String, StringBuffer | 황제낙엽 | 2003.04.14 | 815 |
| 27 | 넷째날 - 추상클래스, 내부클래스, Interface, Static영역 | 황제낙엽 | 2003.04.14 | 814 |
