In java, how to write this date format?
Dec 17 2011 07:37:55:000PM
SimpleDateFormat sdf = new SimpleDateFormat("M W yyyy hh:mm:ss:SSSa"); // failed
I tried this format, it doesn’t work.
Please help, thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think you just need to expand your Month format to 3 M’s and the days char is d not W.
Check here for more information on date formats http://docs.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html