Tabnine Logo
TimeParser.getFuzzyDate
Code IndexAdd Tabnine to your IDE (free)

How to use
getFuzzyDate
method
in
org.geoserver.ows.kvp.TimeParser

Best Java code snippets using org.geoserver.ows.kvp.TimeParser.getFuzzyDate (Showing top 5 results out of 315)

origin: geoserver/geoserver

  durationOffset = parsePeriod(period[0]);
} else {
  begin = beginning(getFuzzyDate(period[0]));
  end = end(getFuzzyDate(period[1]));
  final Calendar calendar = new GregorianCalendar();
  calendar.setTimeInMillis(end.getTime() - durationOffset);
begin = beginning(getFuzzyDate(period[0]));
end = end(getFuzzyDate(period[1]));
origin: geoserver/geoserver

public void testReducedAccuracyYear() throws Exception {
  Calendar c = new GregorianCalendar();
  c.setTimeZone(TimeParser.UTC_TZ);
  DateRange year = (DateRange) TimeParser.getFuzzyDate("2000");
  c.clear();
  c.set(Calendar.YEAR, 2000);
  assertRangeStarts(year, c.getTime());
  c.set(Calendar.YEAR, 2001);
  c.add(Calendar.MILLISECOND, -1);
  assertRangeEnds(year, c.getTime());
  year = (DateRange) TimeParser.getFuzzyDate("2001");
  c.clear();
  c.set(Calendar.YEAR, 2001);
  assertRangeStarts(year, c.getTime());
  c.set(Calendar.YEAR, 2002);
  c.add(Calendar.MILLISECOND, -1);
  assertRangeEnds(year, c.getTime());
  year = (DateRange) TimeParser.getFuzzyDate("-6052");
  c.clear();
  c.set(Calendar.ERA, GregorianCalendar.BC);
  c.set(Calendar.YEAR, 6053);
  assertRangeStarts(year, c.getTime());
  c.set(Calendar.YEAR, 6052);
  c.add(Calendar.MILLISECOND, -1);
  assertRangeEnds(year, c.getTime());
}
origin: geoserver/geoserver

c.clear();
Date instant = (Date) TimeParser.getFuzzyDate("2000-04-04T12:00:00.000Z");
c.set(Calendar.YEAR, 2000);
c.set(Calendar.MONTH, 3); // 0-indexed
        TimeParser.getFuzzyDate(
            "2005-12-31T23:59:60.000Z"); // selected due to leapsecond at
assertEquals(instant, c.getTime());
instant = (Date) TimeParser.getFuzzyDate("-25-06-08T17:15:00.123Z");
c.clear();
c.set(Calendar.ERA, GregorianCalendar.BC);
origin: geoserver/geoserver

Object o = getFuzzyDate(date);
if (o instanceof Date) {
  addDate(result, (Date) o);
origin: geoserver/geoserver

c.clear();
DateRange hour = (DateRange) TimeParser.getFuzzyDate("2000-04-04T12Z");
c.set(Calendar.YEAR, 2000);
c.set(Calendar.MONTH, 3); // 0-indexed
        TimeParser.getFuzzyDate(
            "2005-12-31T23Z"); // selected due to leapsecond at 23:59:60 UTC
c.clear();
assertRangeEnds(hour, c.getTime());
hour = (DateRange) TimeParser.getFuzzyDate("-25-06-08T17Z");
c.clear();
c.set(Calendar.ERA, GregorianCalendar.BC);
org.geoserver.ows.kvpTimeParsergetFuzzyDate

Javadoc

Parses date given in parameter according the ISO-8601 standard. This parameter should follow a syntax defined in the #PATTERNS array to be validated.

Popular methods of TimeParser

  • parse
  • <init>
  • parsePeriod
    Parses the increment part of a period and returns it in milliseconds.
  • addDate
  • addPeriod
    Tries to avoid insertion of multiple time values.
  • beginning
  • checkMaxTimes
  • end
  • getMaxTimes
    Maximum number of times this parser will parse before throwing an exception
  • parseTimeDuration

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • setContentView (Activity)
  • getApplicationContext (Context)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now