Example usage for java.time Period ofWeeks

List of usage examples for java.time Period ofWeeks

Introduction

In this page you can find the example usage for java.time Period ofWeeks.

Prototype

public static Period ofWeeks(int weeks) 

Source Link

Document

Obtains a Period representing a number of weeks.

Usage

From source file:Main.java

public static void main(String[] args) {

    Period p = Period.ofWeeks(12);

    System.out.println(p.toString());

}

From source file:Main.java

public static void main(String[] args) {
    Period p = Period.ofDays(30);
    System.out.println(p);/*from w  w  w.ja  v a  2  s. c o  m*/

    Period p1 = Period.ofMonths(12);
    System.out.println(p1);

    Period p2 = Period.ofWeeks(11);
    System.out.println(p2);

    Period p3 = Period.ofYears(50); // years, months, days
    System.out.println(p3);
}

From source file:sx.blah.discord.handle.impl.obj.Channel.java

@Override
public List<IMessage> bulkDelete() {
    return bulkDelete(getMessageHistoryTo(Instant.now().minus(Period.ofWeeks(2))));
}