Re: Date.getTime()
- From: Gordon Beaton <not@xxxxxxxxx>
- Date: 13 Jan 2006 14:52:33 +0100
On 13 Jan 2006 05:39:47 -0800, fritz-bayer@xxxxxx wrote:
> Now I have noticed, that the miliseconds returned by getDate() are
> not uniformly distributed when it comes to the last digit of the
> long number "milis".
>
> Most of the time it remains zero. I guess that's because the
> miliisecond count is always zero in the dates, which I read in.
> However, I thought that the last digit should be uniformly
> distributed from 0 to 9.
>
> That's in fact what I would like to try to achieve. Can somebody
> tell me, which piece of code will turn the miliseconds returned from
> the Date.getTime() function into a number, whose last digit is
> randomly distributed between 0 and 9 ?
Unless I've completely misunderstood the problem, it seems to me that
for any Date representing a time on a whole second boundary, the
number of milliseconds returned by getTime() will always be a multiple
of 1000.
Do you intend to *modify* the dates in order to achieve a random
distribution in the last digit?
Perhaps the problem is the way the timestamps are generated in the
first place, with second accuracy.
/gordon
--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
.
- References:
- Date.getTime()
- From: fritz-bayer
- Date.getTime()
- Prev by Date: Date.getTime()
- Next by Date: Re: Date.getTime()
- Previous by thread: Date.getTime()
- Next by thread: Re: Date.getTime()
- Index(es):
Relevant Pages
|