Package org.ocpsoft.pretty.time

Examples of org.ocpsoft.pretty.time.PrettyTime.format()


      DateTime time = new DateTime();
      int secondsRemain = 60 - time.getSecondOfMinute();
      DateTime deniedTime = time.plusSeconds(secondsRemain);
      PrettyTime prettyTime = new PrettyTime();
      prettyTime.setUnits(new Second(prettyTime.getLocale()));
      return prettyTime.format(deniedTime.toDate());
   }

   public String getSecondsUntilDenied()
   {
      DateTime time = new DateTime();
View Full Code Here


      DateTime time = new DateTime();
      int secondsRemain = 30 - time.getSecondOfMinute();
      DateTime grantedTime = time.plusSeconds(secondsRemain);
      PrettyTime prettyTime = new PrettyTime();
      prettyTime.setUnits(new Second(prettyTime.getLocale()));
      return prettyTime.format(grantedTime.toDate());
   }
}
View Full Code Here

  }

  /* Added by Per Henrik Lausten */
  public String getPrettyTime() {
    PrettyTime p = new PrettyTime();
    return p.format(this.getPublicationDate());
  }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.