Examples of formatApproximateDuration()


Examples of org.ocpsoft.prettytime.PrettyTime.formatApproximateDuration()

   public void testFormatApproximateDuration() throws Exception
   {
        long tenMinMillis = java.util.concurrent.TimeUnit.MINUTES.toMillis(10);
        Date tenMinAgo = new Date(System.currentTimeMillis()-tenMinMillis);
        PrettyTime t = new PrettyTime();
        String result = t.formatApproximateDuration(tenMinAgo);
        assert result.equals("10 minutes");      
   }

   @Test
   public void testCalculatePreciseDuration()
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.