java - Parse Error while parsing date in Android -
as continuation of this question, error doesn't seem resolved. date in sqlite stored 2015-04-25
of form yyyy-mm-dd
. date (which system date) stored in db using current_date variable , fetched string. minimal code shown below:
simpledateformat dateformat = new simpledateformat("yyyy-mm-dd hh:mm:ss"); date taskdate = dateformat.parse(dateformat.format(new date("2015-04-25")));
but exception as:
parse error: 2015-04-25
try working code.
format formatter = new simpledateformat("yyyy-mm-dd hh:mm:ss"); string formattedcode = formatter.format("supply date-time here");
i believe should either add time along date when supply input or have remove hh:mm:ss
part.
Comments
Post a Comment