public static Date getPublishDate(Page page) {
Date newDate = null;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd", Locale.getDefault());
if (page != null) {
String publishedDate = page.getProperties().get("publisheddate", "");
if(!"".equals(publishedDate)){
try {
newDate = sdf.parse(publishedDate);
} catch (ParseException e) {
}
}
}
return newDate;
}
No comments:
Post a Comment
If you have any doubts or questions, please let us know.