java - Converting date.toString() to date -
i'm trying convert string date. i've got example here input string hardcoded string.
try { string currentdate = "tue jan 05 21:19:57 cet 2016"; date d = new simpledateformat("eee mmm dd hh:mm:ss zzz yyyy", locale.us).parse(currentdate); } catch (parseexception e) { e.printstacktrace(); } for reason, throws following exception:
parseexception: unparseable date: "tue jan 05 21:19:57 cet 2016" (at offset 20) could me problem? thanks!
your problem described java.text.parseexception: unparseable date
your machine local can effect local used in simpledateformat
Comments
Post a Comment