1 16 17 package org.apache.log4j.helpers; 18 19 import java.util.Date ; 20 import java.text.FieldPosition ; 21 import java.text.ParsePosition ; 22 import java.text.DateFormat ; 23 24 33 public class RelativeTimeDateFormat extends DateFormat { 34 35 protected final long startTime; 36 37 public 38 RelativeTimeDateFormat() { 39 this.startTime = System.currentTimeMillis(); 40 } 41 42 48 public 49 StringBuffer format(Date date, StringBuffer sbuf, 50 FieldPosition fieldPosition) { 51 return sbuf.append((date.getTime() - startTime)); 53 } 54 55 58 public 59 Date parse(java.lang.String s, ParsePosition pos) { 60 return null; 61 } 62 } 63 | Popular Tags |