code: private long correctTimeStamp(long daysSinceEpoch) {
      long timestamp = (daysSinceEpoch*DAY_TO_MS+ADD_OFFSET);
      DateTime date = new DateTime(timestamp);
      int hour = date.hourOfDay().get();
      if (hour == 0)
        return timestamp;
      else
        return (timestamp-hour*HOUR_OFFSET);
    }
docs: This method is written to take care of the leap seconds, leap year effects.  Our original
  plan of converting number of days from epoch does not quite work out right due to all these
  leap seconds, years accumulated over the century.  However, I do notice that when we are
  not correcting for the leap seconds/years, if we build a dateTime object, the hour does not
  work out to be 00.  Instead it is off.  In this case, we just calculate the offset and take
  if off our straight forward timestamp calculation.
  
  @param daysSinceEpoch: number of days since epoch (1970 1/1)
  @return long: correct timestamp corresponding to daysSinceEpoch