directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niclas Hedhman <nic...@hedhman.org>
Subject Re: [ldap] Need volunteer from another timezone :-)
Date Sun, 19 Dec 2004 21:18:54 GMT
On Monday 20 December 2004 03:58, Brett Porter wrote:
> IIRC, it would be fixed by using a UTC timezone in the class itself, but
> I wasn't sure what effect that would have. I think the comment I added
> attempted to explain this. I can work with you on this to test some fixes.

Not sure if you guys are talking about the DateUtils.getGeneralizedTime( long 
millis ) ...

If so, may I suggest a re-write, which makes things a lot clearer, with 
approx. four lines of code;

public static String getGeneralizedTime( long millis )
{
    TimeZone tz = TimeZone.getTimeZone( "UTC" );
    SimpleDateFormat sdf = new SimpleDateFormat( "yyyyMMddHHmmZ" );
    sdf.setTimeZone( tz );
    return sdf.format( millis );
}

Performance implications has not been evaluated, but testing should be a lot 
easier and more reliable.

As for performance, I think static creation of the SDF, and use of 
synchronization gives a significantly lower latency, but then one may need 
start pooling these not to create a bottleneck.


Cheers
Niclas


Cheers
Niclas
-- 
   +------//-------------------+
  / http://www.dpml.net       /
 / http://niclas.hedhman.org / 
+------//-------------------+


Mime
View raw message