- Forum posts: 8
Feb 9, 2016, 7:53:47 AM via Website
Feb 9, 2016 7:53:47 AM via Website
I want to parse string, date and time from a user defined sentence. For eg. In a sentence " Project review meeting is on October 6th 2016 at 9.00 am." String: Project review meeting, Date: 2016/10/06, time 09.00 a.m. should be separated. Please suggest me how to do this?
Thanks in advance.
I have tried with the below code.
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
try {
date = format.parse(edittext.getText().toString());
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
datetext.setText("" +date);
— modified on Feb 9, 2016, 10:27:51 AM
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.