This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 7th, 2012  |  syntax: None  |  size: 0.53 KB  |  views: 23  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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");
clone this paste RAW Paste Data