Here you can find the source of alignQueryTimestampToBaseAggregationTime(long queryTimestamp)
public static long alignQueryTimestampToBaseAggregationTime(long queryTimestamp)
//package com.java2s; //License from project: Open Source License public class Main { public final static int AGGREGATION_TIME_INTERVAL = 60; public static long alignQueryTimestampToBaseAggregationTime(long queryTimestamp) { if (isBaseAggregationTimestamp(queryTimestamp)) { return queryTimestamp; } else {//from ww w .jav a 2 s . c o m return queryTimestamp - queryTimestamp % AGGREGATION_TIME_INTERVAL; } } public static boolean isBaseAggregationTimestamp(long timestamp) { return timestamp % AGGREGATION_TIME_INTERVAL == 0; } }