ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/util/uk/org/iscream/cms/util/DateUtils.java
(Generate patch)

Comparing projects/cms/source/util/uk/org/iscream/cms/util/DateUtils.java (file contents):
Revision 1.3 by tdb, Wed Mar 14 23:25:29 2001 UTC vs.
Revision 1.4 by tdb, Fri Mar 16 17:14:23 2001 UTC

# Line 191 | Line 191 | public class DateUtils {
191          return layout;
192      }
193      
194 +    /**
195 +     * Takes a time period in seconds and converts it to a
196 +     * reasonable message.
197 +     *
198 +     * @param time the time period in seconds
199 +     * @return a String respresentation of the given time period
200 +     */
201 +    public static String getTimeString(long time) {
202 +        String timeString = null;
203 +        if (time >= 3600) {
204 +            timeString = ((time/60) / 60) + " hour(s)";
205 +        } else if (time >= 60) {
206 +            timeString = (time / 60) + " minute(s)";
207 +        } else {
208 +            timeString = time + " second(s)";
209 +        }
210 +        return timeString;
211 +    }
212  
213   //---CONSTRUCTORS---
214  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines