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

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

Introduction

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

Prototype

public int getMonthOfYear() 

Source Link

Document

Get the month of year 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;//  w  w w. j  ava2  s  . c  o  m
        }
        if (month < 1 || month > 12) {
            valid = false;
        }
        if (day < 1 || day > 31) {
            valid = false;
        }
        if (!valid) {
            tag.setDate(null);
        }
    }
}