[concurrency-interest] Re: SynchronizedLong vs. other locks

Gregg Wonderly gregg at cytetech.com
Fri Jul 8 11:39:32 EDT 2005



Tim Peierls wrote:
> Tim Peierls wrote:
> 
>> Answering my own question: No, it doesn't. The program below produces 
>> this output on my machine (today):
>>
>> t1 = 1120881600000
>> t2 = 1120867200000
>>
>> a difference of 4 minutes. (Hmm, why four minutes? Only 23 leap 
>> seconds have been inserted since the epoch.)
> 
> 
> Ah, four *hours*! That's the time zone difference. Sorry.
> 
> But can one always count on System.currentTimeMillis() in this way?

Millisecond times in Java are always UTC milliseconds.  The Locale forces the display of a particular 'time' when you 
use java.util.Date().toString(), or Calendar.toString() etc.

I do think that leap seconds are ignored as a concept in the GregorianCalendar implementation.

Gregg Wonderly


More information about the Concurrency-interest mailing list