Skip to content

Instantly share code, notes, and snippets.

@dynoChris
Created September 23, 2019 09:03
Show Gist options
  • Select an option

  • Save dynoChris/79c6a48bcbf6b771502017f53c702013 to your computer and use it in GitHub Desktop.

Select an option

Save dynoChris/79c6a48bcbf6b771502017f53c702013 to your computer and use it in GitHub Desktop.
How to convert date
public static String modifyDate(String incomeDate) {
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date d = sdf.parse(incomeDate);
SimpleDateFormat sdfOut = new SimpleDateFormat("LLL dd, yyyy");
String dateAsString = sdfOut.format(d);
return dateAsString;
} catch (Exception exc) {
exc.printStackTrace();
}
return "";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment