Skip to content

Tag: epoch

Epoch time confusion, clarification needed

Given: As i understand it, the result comes back with time since the epoch, in milliseconds The current time as UTC milliseconds from the epoch. Given that my test always sets the objects the same, why are results coming up different as time goes by? UPDATE: I continue to second guess myself due to For the same time period i

How do you create a proper Epoch calendar object in Java?

I want to create a calendar object that is the epoch date. What’s the ‘correct’ (if any) way to do it? Answer The ‘setTimeInMillis()’ method would work fine and be easily understood by others. It might also be clearer if you passed it 0 instead of 1. The first method has more line noise and just adds more chances that