Hi,

Currently Commit.getModified has following impl

-----
public static long getModified(long timestamp) {
        // 5 second resolution
        return timestamp / 1000 / 5;
 }
-----

The result when treated as timestamp cause the time to set to 0 i.e. 1970

I intend to fix this with (looking at comment)

-----
    public static long getModified(long timestamp) {
        long timeInSec = TimeUnit.MILLISECONDS.toSeconds(timestamp);
        timeInSec = timeInSec - timeInSec % 5;
        return TimeUnit.SECONDS.toMillis(timeInSec);
    }
-----

Would that be correct approach?

Chetan Mehrotrarted

Reply via email to