티스토리 뷰

프로그래밍을 하다보면 오늘 날짜로 디렉토리 만들어야 할 일이 많다.

DateFormat dfFormat = new SimpleDateFormat("yyyyMMdd");

    Date nowDate = new Date();

    String toDate = format.dfFormat(nowDate);

    String filePath = toDate+"/";

    String fullPath=rootPath+filePath;

    File file = new File(fullPath);

    if(!file.isDirectory){

        file.mkdirs();

    }
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/11   »
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
글 보관함