avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bachran, Michael" <MBach...@onebridge.de>
Subject Date Formatter for LogKitManagement
Date Tue, 11 Dec 2001 12:51:34 GMT
Hi,

I would like to use a formatter using the simple date format for dates. It
might be usefull to everyone to have this integrated in the
LogKitManagement. So I would like to suggest patching the PatternFormatter
like this:

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

...

    protected String getTime( final long time, final String format )
    {
+        if ( format == null )
+        {
            return Long.toString( time );
+        }

+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat( format );
+        return( simpleDateFormat.format( new Date( time ) ) );        
    }


What do you think?

Michael

Mime
View raw message