Example usage for org.joda.time Period withSeconds

List of usage examples for org.joda.time Period withSeconds

Introduction

In this page you can find the example usage for org.joda.time Period withSeconds.

Prototype

public Period withSeconds(int seconds) 

Source Link

Document

Returns a new period with the specified number of seconds.

Usage

From source file:nz.co.gregs.dbvolution.internal.datatypes.DateRepeatImpl.java

License:Apache License

/**
 *
 * @param intervalStr// ww w .  ja  va2 s  . c o  m
 * @return the DateRepeat value represented by the String value
 */
public static Period parseDateRepeatFromGetString(String intervalStr) {
    if (intervalStr == null || intervalStr.length() == 0) {
        return null;
    }
    System.out.println("DBV INTERVAL: " + intervalStr);
    Period interval = new Period();
    interval = interval.withYears(getYearPart(intervalStr));
    interval = interval.withMonths(getMonthPart(intervalStr));
    interval = interval.withDays(getDayPart(intervalStr));
    interval = interval.withHours(getHourPart(intervalStr));
    interval = interval.withMinutes(getMinutePart(intervalStr));
    interval = interval.withSeconds(getSecondPart(intervalStr));
    interval = interval.withMillis(getMillisecondPart(intervalStr));
    return interval;
}