일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- db
- Oracle
- MySQL
- tool
- springboot
- ReactJS
- jenkins
- Design Patterns
- laravel
- php
- Spring Boot
- AWS
- Spring
- IntelliJ
- it
- 요리
- linux
- docker
- jsp
- ubuntu
- Git
- elasticsearch
- redis
- JPA
- Gradle
- Web Server
- devops
- 맛집
- javascript
- java
- Today
- Total
목록2019/06/20 (3)
아무거나
import java.utill.*; public class MapEx { // Map은 키값(K)와 Value(V)값을 선언 할 수 있다. Map myMap = new HashMap(); myMap.put(1, "JAVA"); myMap.put(2, "JSP"); myMap.put(3, "Servlet"); // myMap.containsKey (key값 검색해서 같은 키값이 있으면) if ( myMap.containsKey(1) ) { // 1번 키값에 해당하는 value를 리턴함 String str = myMap.get(1); System.out.println(str); } System.out.println("\n====================="); // values() : Map 타입의 ..
import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class DateCompare { public static void main(String [] args) { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); Date day1 = null; Date day2 = null; try { day1 = format.parse("2012-12-16"); day2 = format.parse("2012-12-17"); } catch (ParseException e) { e.printStackTrace(); } int compare..
String to Date String from = "2013-04-08 10:10:10"; SimpleDateFormat transFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date to = transFormat.parse(from); Date to String Date from = new Date(); SimpleDateFormat transFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String to = transFormat.format(from);