title: How to Convert FileTime to String with DateFormat
body: <p>I'm attempting to convert the creationTime attribute of a file to a string with a date format of MM/dd/yyyy.  I am using Java nio to obtain the the creationTime attribute, which is of <code>FileTime</code> type, but I just want the date from this <code>FileTime</code> as a string with the date format specified previously.  So far I have ...</p>
  
  <pre><code>String file = "C:\\foobar\\example.docx";
  Path filepath = Paths.get(file);
  BasicFileAttributes attr = Files.readAttributes(filepath,BasicFileAttributes.class); 
  FileTime date = attr.creationTime();
  DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
  String dateCreated = df.format(date);
  </code></pre>
  
  <p>However, it throws an exception saying it cannot format the <code>FileTime date</code> object as a Date.  FileTime seems to output in form of <code>2015-01-30T17:30:57.081839Z</code> for example.  What solution would you recommend to best solve this?  Should I just use regex on that output or is there a more elegant solution?</p>