Example usage for org.joda.time.base BaseDateTime getDayOfMonth

List of usage examples for org.joda.time.base BaseDateTime getDayOfMonth

Introduction

In this page you can find the example usage for org.joda.time.base BaseDateTime getDayOfMonth.

Prototype

public int getDayOfMonth() 

Source Link

Document

Get the day of month field value.

Usage

From source file:com.foundationdb.server.types.mcompat.mtypes.MDateAndTime.java

License:Open Source License

/** Pass components of {@code dt} to {@link #encodeDateTime(long, long, long, long, long, long)}. */
public static long encodeDateTime(BaseDateTime dt) {
    return encodeDateTime(dt.getYear(), dt.getMonthOfYear(), dt.getDayOfMonth(), dt.getHourOfDay(),
            dt.getMinuteOfHour(), dt.getSecondOfMinute());
}

From source file:net.sourceforge.atunes.kernel.modules.tags.TagReader.java

License:Open Source License

private void validateDate(final ITag tag) {
    if (tag != null && tag.getDate() != null) {
        BaseDateTime date = tag.getDate();
        int year = date.getYear();
        int month = date.getMonthOfYear();
        int day = date.getDayOfMonth();
        boolean valid = true;
        if (year < 1000 || year > 9999) {
            valid = false;//from   w ww.j  av a2 s.c om
        }
        if (month < 1 || month > 12) {
            valid = false;
        }
        if (day < 1 || day > 31) {
            valid = false;
        }
        if (!valid) {
            tag.setDate(null);
        }
    }
}