Examples of toDateTimeAtStartOfDay()


Examples of org.joda.time.LocalDate.toDateTimeAtStartOfDay()

                            // also requires the TimeZone offset to be
                            // "undone"
                            final LocalDate localDate = (LocalDate) value;
                            final int millisOffset = -DateTimeZone.getDefault().getOffset(null);
                            final java.util.Date javaDate =
                                localDate.toDateTimeAtStartOfDay(DateTimeZone.forOffsetMillis(millisOffset)).toDate();

                            statement.setObject(i, javaDate, java.sql.Types.DATE);
                        }
                    } else if (value instanceof InputStream) {
                        statement.setBlob(i, (InputStream) value);
View Full Code Here

Examples of org.joda.time.LocalDate.toDateTimeAtStartOfDay()

    int targetYear = firstTargetDate.getYear();

    for (; targetYear <= lastTargetDate.getYear();) {
      LocalDate d = new LocalDate(targetYear, targetMonth, targetDay, targetChrono);
      if (interv.contains(d.toDateTimeAtStartOfDay())) {
        holidays.add(convertToISODate(d));
      }
      targetYear++;
    }
    return holidays;
View Full Code Here

Examples of org.joda.time.LocalDate.toDateTimeAtStartOfDay()

        DateTimeZone dateTimeZone = DateTimeZone.forTimeZone(timeZone);

        // Compute the start and end of that date in milliseconds for comparing
        // and truncating start/end
        LocalDate facetLocalDate = LocalDate.parse(facet.date);
        long dateStart = facetLocalDate.toDateTimeAtStartOfDay(dateTimeZone).getMillis();
        long dateEnd = dateStart + DateTimeConstants.MILLIS_PER_DAY;

        if(timeInterval.getTimeUnit()!= TimeUnit.ARBITRARY) {
            // This is a date-based query.  In case this is an endcap facet, meaning it either
            // crosses the leading or trailing midnight of a day,
View Full Code Here

Examples of org.joda.time.LocalDate.toDateTimeAtStartOfDay()

public class MonthMetadata extends AbstractTimespanMetadata {

    public MonthMetadata(final int year, final int month) {
        final LocalDate firstDayOfMonth = TimeUtils.getBeginningOfMonth(year, month);
        this.startDate = TimeUtils.dateFormatter.print(firstDayOfMonth);
        this.start = firstDayOfMonth.toDateTimeAtStartOfDay().getMillis();

        final LocalDate lastDayOfMonth = TimeUtils.getEndOfMonth(year, month);
        this.endDate = TimeUtils.dateFormatter.print(lastDayOfMonth);
        this.end = lastDayOfMonth.toDateTimeAtStartOfDay().getMillis() + DateTimeConstants.MILLIS_PER_DAY;
    }
View Full Code Here

Examples of org.joda.time.LocalDate.toDateTimeAtStartOfDay()

        this.startDate = TimeUtils.dateFormatter.print(firstDayOfMonth);
        this.start = firstDayOfMonth.toDateTimeAtStartOfDay().getMillis();

        final LocalDate lastDayOfMonth = TimeUtils.getEndOfMonth(year, month);
        this.endDate = TimeUtils.dateFormatter.print(lastDayOfMonth);
        this.end = lastDayOfMonth.toDateTimeAtStartOfDay().getMillis() + DateTimeConstants.MILLIS_PER_DAY;
    }

    public MonthMetadata(final VisitedCity consensusVisitedCity,
                         VisitedCity previousInferredCity, VisitedCity nextInferredCity,
                         Map<String, TimeZone> consensusTimezones, TimezoneMap timezoneMap,
View Full Code Here

Examples of org.joda.time.LocalDate.toDateTimeAtStartOfDay()

        final TimeZone startTz = consensusTimezones.get(this.startDate);
        final TimeZone endTz = consensusTimezones.get(this.endDate);

        // Finally, calculate start and and using the start and end timezones
        this.start = beginningOfMonth.toDateTimeAtStartOfDay(DateTimeZone.forTimeZone(startTz)).getMillis();
        this.end = endOfMonth.toDateTimeAtStartOfDay(DateTimeZone.forTimeZone(endTz)).getMillis() + DateTimeConstants.MILLIS_PER_DAY;
    }

    public static long getEndOfMonth(String timeZone, final int year, final int month) {
        final DateTimeZone consensusTimezone = DateTimeZone.forID(timeZone);
        final LocalDate lastDayOfMonth = TimeUtils.getEndOfMonth(year, month);
View Full Code Here

Examples of org.joda.time.LocalDate.toDateTimeAtStartOfDay()

    }

    public static long getEndOfMonth(String timeZone, final int year, final int month) {
        final DateTimeZone consensusTimezone = DateTimeZone.forID(timeZone);
        final LocalDate lastDayOfMonth = TimeUtils.getEndOfMonth(year, month);
        long t = lastDayOfMonth.toDateTimeAtStartOfDay(consensusTimezone).getMillis() + DateTimeConstants.MILLIS_PER_DAY;
        return t;
    }

    public static long getStartOfMonth(String timeZone, final int year, final int month) {
        final LocalDate firstDayOfMonth = TimeUtils.getBeginningOfMonth(year, month);
View Full Code Here

Examples of org.joda.time.LocalDate.toDateTimeAtStartOfDay()

    }

    public static long getStartOfMonth(String timeZone, final int year, final int month) {
        final LocalDate firstDayOfMonth = TimeUtils.getBeginningOfMonth(year, month);
        final DateTimeZone consensusTimezone = DateTimeZone.forID(timeZone);
        final long t = firstDayOfMonth.toDateTimeAtStartOfDay(consensusTimezone).getMillis();
        return t;
    }

    @Override
    protected TimeUnit getTimespanTimeUnit() {
View Full Code Here

Examples of org.joda.time.LocalDate.toDateTimeAtStartOfDay()

public class WeekMetadata extends AbstractTimespanMetadata {

    public WeekMetadata(final int year, final int week) {
        final LocalDate beginningOfWeek = TimeUtils.getBeginningOfWeek(year, week);
        this.startDate = TimeUtils.dateFormatter.print(beginningOfWeek);
        this.start = beginningOfWeek.toDateTimeAtStartOfDay().getMillis();

        // endDate is the last day of the same week as startDate, so add 6 not 7
        final LocalDate endOfWeek = beginningOfWeek.plusDays(6);
        this.endDate = TimeUtils.dateFormatter.print(endOfWeek);
        this.end = endOfWeek.toDateTimeAtStartOfDay().getMillis() + DateTimeConstants.MILLIS_PER_DAY;
View Full Code Here

Examples of org.joda.time.LocalDate.toDateTimeAtStartOfDay()

        this.start = beginningOfWeek.toDateTimeAtStartOfDay().getMillis();

        // endDate is the last day of the same week as startDate, so add 6 not 7
        final LocalDate endOfWeek = beginningOfWeek.plusDays(6);
        this.endDate = TimeUtils.dateFormatter.print(endOfWeek);
        this.end = endOfWeek.toDateTimeAtStartOfDay().getMillis() + DateTimeConstants.MILLIS_PER_DAY;
    }

    public WeekMetadata(final VisitedCity consensusVisitedCity,
                        VisitedCity previousInferredCity, VisitedCity nextInferredCity,
                        Map<String, TimeZone> consensusTimezones, TimezoneMap timezoneMap,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.