Example usage for org.apache.commons.lang.time DateUtils RANGE_WEEK_SUNDAY

List of usage examples for org.apache.commons.lang.time DateUtils RANGE_WEEK_SUNDAY

Introduction

In this page you can find the example usage for org.apache.commons.lang.time DateUtils RANGE_WEEK_SUNDAY.

Prototype

int RANGE_WEEK_SUNDAY

To view the source code for org.apache.commons.lang.time DateUtils RANGE_WEEK_SUNDAY.

Click Source Link

Document

A week range, starting on Sunday.

Usage

From source file:MainClass.java

public static void main(String[] pArgs) throws Exception {
    Date now = new Date();
    System.out.println("now: " + DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.format(now));
    Iterator iter = DateUtils.iterator(now, DateUtils.RANGE_WEEK_SUNDAY);
    while (iter.hasNext()) {
        Calendar cal = (Calendar) iter.next();
        Date cur = cal.getTime();
        System.out.println("iterate: " + DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.format(cur));
    }//from   w w w  .j  a  v a  2  s .c  o  m
}

From source file:com.discursive.jccook.lang.DateFormatExample.java

public void testIterator() throws Exception {
    Date now = new Date();
    logger.debug("now: " + DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.format(now));
    Iterator iter = DateUtils.iterator(now, DateUtils.RANGE_WEEK_SUNDAY);
    while (iter.hasNext()) {
        Calendar cal = (Calendar) iter.next();
        Date cur = cal.getTime();
        logger.debug("iterate: " + DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.format(cur));
    }/*from   w  ww.j  ava  2s . c om*/
}