Webwarp Util Datetime

General

The package contains several helper classes and utilities for working with java.util.Date instances.

Class Overview

Example Usage

DateCompletionParser

DateCompletionParser dateParser = new DateCompletionParser(DateCompletionParser.COMPLETE_MONTH_AND_YEAR); boolean ok = dateParser.parse("23"); ate date = dateParser.getDate(); // other sample inputs dateParser.parse("2/6-2005"); dateParser.parse("2/6-5"); dateParser.parse("1.3"); D

DateTimeCompletionParser

DateTimeCompletionParser parser = new DateTimeCompletionParser(); boolean ok = parser.parse("1.3.03 12:15:30"); if(parser.hasDate()){ [...] } if(parser.hasTime()){ [...] } // other sample inputs parser.parse("19 19"); parser.parse("10.03.2003"); parser.parse("16:5 ");

TimeCompletionParser

TimeCompletionParser parser = new TimeCompletionParser(); boolean ok = parser.parse("12:15"); if(parser.hasDate()){ [...] } if(parser.hasTime()){ [...] } // other sample inputs parser.parse("12"); parser.parse("12:3");

DateVerifier

This class is used for checking if a day, month, year combination maps to a valid date.

int day = 11; int month = 3; int year = 1977; boolean validDate = DateVerifier.verifyDate(day, month, year);

TimeVerifier

This class is used for checking if a hour, minute, seconds combination maps to a valid time within a 24h system.

int hour = 11; int minute = 3; int seconds = 34; boolean validDate = DateVerifier.verifyDate(hour, minutes, seconds);

Webwarp Util