Skip to content

Commit

Permalink
Show prettier date and time
Browse files Browse the repository at this point in the history
  • Loading branch information
luksa committed Mar 14, 2014
1 parent 25760ae commit 2926ab8
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -23,6 +23,8 @@
package org.jboss.capedwarf.admin;

import javax.inject.Named;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
Expand All @@ -31,7 +33,9 @@
@Named
public class TimeFormatter {

public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");

public String format(long usec) {
return new Date(usec / 1000).toString();
return DATE_FORMAT.format(new Date(usec / 1000));
}
}

0 comments on commit 2926ab8

Please sign in to comment.