Q:

How to use a String with Date to create a new File in Java

Why am I able to create a directory like this:
new File("./HISTORY/www").mkdirs();
But if I try to use a String, then nothing happens:
    String path = "./HISTORY/" + history_folder_name;
        new File(path).mkdirs();

This does not create the directory like the other one does. Why?
EDIT: this is how I am creating the folder name:
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
         Date now = new Date();
         String strDate = sdf.format(now);
         history_folder_name = "folderName";

It works fine if i take out the HH:mm:ss:SSS but I need them. What solution is there?

A:

Change the
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");

to
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH.mm.ss.SSS");

