Advertisement
Guest User

Untitled

a guest
Aug 7th, 2012
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. how to format time using java with flex?
  2. try {
  3. String str_date = "Sat Aug 4 13:10:00 GMT+0530 2012";
  4.  
  5. DateFormat formatter = new SimpleDateFormat(
  6. "EEE MMM dd HH:mm:ss zzzz yyyy");
  7. Date date = (Date) formatter.parse(str_date);
  8. System.out.println(date);
  9. } catch (ParseException e) {
  10. System.out.println("Exception :" + e);
  11. }
  12.  
  13. `Exception :java.text.ParseException: Unparseable date: "Sat Aug 4 13:10:00 GMT+0530 2012"`
  14.  
  15. DateFormat formatter = new SimpleDateFormat("EEE MMM dd HH:mm:ss 'GMT'Z yyyy");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement