Changeset 417


Ignore:
Timestamp:
11/20/08 15:32:25 (16 years ago)
Author:
ra33
Message:

Fixed formatting problem for times.. which did not work for times greater than 12 hours

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/io/Logger.java

    r362 r417  
    3737
    3838        public static final String LONG_DATE_FORMAT = "ddMMMyyyy[HH:mm]";
    39        
     39
    4040        public static final String SYSTEM = "S";
    4141
     
    159159                return (new SimpleDateFormat(format)).format(date);
    160160        }
    161        
     161
    162162        public static String EasyTimeFormat(Time time) {
    163                 return (new SimpleDateFormat("KK:mm:ss")).format(time);
     163                /*
     164                 * Truncate the millis
     165                 */
     166                long total = time.getTime() / 1000;
     167                long seconds = total % 60;
     168                // Truncate the secs
     169                total /= 60;
     170                long minutes = total % 60;
     171                // Truncate the minutes
     172                long hours = total / 60;
     173
     174                return String.format("%1$02d:%2$02d:%3$02d", hours, minutes, seconds);
    164175        }
    165176
Note: See TracChangeset for help on using the changeset viewer.