How to use toPattern() method of java.text.SimpleDateFormat class?