Index: branches/APG_ES_Product/Java/nsight-product-availability/src/main/java/com/genpt/nsight/v4/service/impl/Site2SiteDeliveryEstimateServiceV4Impl.java =================================================================== diff -u -r255101 -r255782 --- branches/APG_ES_Product/Java/nsight-product-availability/src/main/java/com/genpt/nsight/v4/service/impl/Site2SiteDeliveryEstimateServiceV4Impl.java (.../Site2SiteDeliveryEstimateServiceV4Impl.java) (revision 255101) +++ branches/APG_ES_Product/Java/nsight-product-availability/src/main/java/com/genpt/nsight/v4/service/impl/Site2SiteDeliveryEstimateServiceV4Impl.java (.../Site2SiteDeliveryEstimateServiceV4Impl.java) (revision 255782) @@ -525,10 +525,20 @@ // if processing a current day cutoff, check if its past the cutoff time if (deliveryCutOff.getDayOfTheWeek() == availabilityServiceContextV3.getDayOfWeekLocal()) { + + //getting cutoff time with date so that we can compare the time with date also in order to handle different time zone issue + String cutOffDateTime = null; + if (localCrossedUTCMidnight && !isNextDay) { + ZonedDateTime beginningOfDayBack = beginningOfDayUTC.minusDays(1); + cutOffDateTime = availabilityServiceContextV3.getDateTime(0, deliveryCutOff.getCutOffTime(), beginningOfDayBack, isNextDay, "Days", deliveryDayOfWeek, localCrossedUTCMidnight); + }else + cutOffDateTime = availabilityServiceContextV3.getDateTime(0, deliveryCutOff.getCutOffTime(), beginningOfDayUTC, isNextDay, "Days", deliveryDayOfWeek, localCrossedUTCMidnight); + + //we are processing a current day cutoff if (availabilityServiceContextV3.getStoreOffSetTime() != null && shipFromTZ != 0 && nSightCache.getSiteIdToSiteMap().get(siteID).getTimeZoneID()!=null) {// this needs to work for days, minutes, hours, etc., minutes, hours, etc. // if (!availabilityServiceContextV3.requestTimeBeforeCutOffTime(deliveryCutOff.getCutOffTime(), shipFromTZ, deliveryCutOff.getDeliveryEstimate().getDurationMinValue()))//expects millis - if (!availabilityServiceContextV3.requestTimeBeforeCutOffTime(deliveryCutOff.getCutOffTime(), shipFromTZ, deliveryCutOff.getDeliveryEstimate().getDurationMinValueWithLeadTime(),nSightCache.getSiteIdToSiteMap().get(siteID)))//need to use lead times + if (!availabilityServiceContextV3.requestDateTimeBeforeCutOffTime(cutOffDateTime, shipFromTZ, deliveryCutOff.getDeliveryEstimate().getDurationMinValueWithLeadTime(),nSightCache.getSiteIdToSiteMap().get(siteID)))//need to use lead times afterCutOff = true; } else { long nowCurrentDay = 1000000 * availabilityServiceContextV3.getTimeOfDay();