Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
Tags
- 전역객체
- nodejs
- git
- 포워드 엔지니어링
- container-fluid
- it지원
- templet
- 자바 로또
- bubblesort
- resultType="hashmap"
- SQL
- a href="#" onclick="return false"
- REST
- $('input [name=
- $(document).on
- ${}
- BCrypt
- #{}
- nodejs http
- interface default
- MariaDB
- 알고리즘
- 유효성
- 최대값 최소값
- 자바 예상문제
- git 명령어
- gradle 설치
- git message
- map형태 jsp와 mapper
- cmd mariaDB
Archives
- Today
- Total
Rubberduck-Debugging
printf, SimpleDateFormat 본문
* printf 관련자료
서식 문자는 정수만 출력하는 것이 아니라 다양한 변수를 출력 할 수 있다.
서식 문자 | 설명 |
%s | 문자열 |
%c | 문자 |
%d | 부호 있는 정수 |
%u | 부호 없는 정수 |
%f | 실수 |
%0.2f | 소수점 2자리 까지 나오는 실수 |
%X | 16진수 대문자 |
%x | 16진수 소문자 |
| %02X | 2자리 16진수 표시, 앞자리는 0으로 채움 |
*String -> java.sql.date로 형변환
dateformat();
*String -> java.util.date로 형변환
* SimpleDateFormat#parse()는 String을 date형으로 바꿔줍니다.
String oldstring = "2011-01-18 00:00:00.0";
Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S").parse(oldstring);* SimpleDateFormat#format()는 Date형식으로 String에 값을 넣어줍니다.
String newstring = new SimpleDateFormat("yyyy-MM-dd").format(date);
System.out.println(newstring); // 2011-01-18
#java util 부모, java sql.Date가 자식.
시, 분, 초까지 가져오려면 java.util.date를 써야한다
'개발자' 카테고리의 다른 글
| ajax error message (0) | 2019.01.01 |
|---|---|
| git log message (0) | 2018.12.09 |
| Spring MVC (1) | 2018.12.06 |
| 여기어때 면접에서 듣게 되는 질문 (0) | 2018.12.03 |
| 스키마 (0) | 2018.11.04 |