Skip to content

Instantly share code, notes, and snippets.

@AdamMc331
Created April 28, 2015 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdamMc331/4649e0f1fec5cf89aaa0 to your computer and use it in GitHub Desktop.
Save AdamMc331/4649e0f1fec5cf89aaa0 to your computer and use it in GitHub Desktop.
public static String getUIDateString(LocalDate d){
// Do not allow dates with negative years
if(d.getYear() < 0){
throw new UnsupportedOperationException("LocalDate has negative year value.");
} else {
DateTimeFormatter dtf = DateTimeFormat.forPattern(UI_DATE_FORMAT);
return dtf.print(d);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment