Example #1
0
 /**
  * 格式化日期
  *
  * @param date
  * @return
  */
 public String formatDate(Date date) {
   String dateStr = "";
   if (date != null) {
     PrettyTime prettyTime = new PrettyTime(Locale.CHINA);
     dateStr = prettyTime.format(date);
   }
   return dateStr.replace(" ", "");
 }
Example #2
0
 public String getLastUpdateStr() {
   PrettyTime p = new PrettyTime(new Locale("zh"));
   return p.format(this.updateTime) + "更新";
 }
 public static final String prettyTime(long millisecond) {
   PrettyTime p = new PrettyTime();
   return p.format(new Date(millisecond));
 }
 /**
  * 美化时间 如显示为 1小时前 2分钟前
  *
  * @return
  */
 public static final String prettyTime(Date date) {
   PrettyTime p = new PrettyTime();
   return p.format(date);
 }
Example #5
0
 public static String beautyTime(Date createTime) {
   PrettyTime pt = new PrettyTime(Locale.CHINA);
   return pt.format(createTime);
 }