cdm/src/main/java/ucar/nc2/units/DateUnit.java
static public Date getStandardDate(String text) {
    double value;
    String udunitString;

    text = text.trim();
    StringTokenizer stoker = new StringTokenizer(text);
    String firstToke = stoker.nextToken();
    try {
      value = Double.parseDouble(firstToke);
      udunitString = text.substring(firstToke.length());
    } catch (NumberFormatException e) { // stupid way to test if it starts with a number
      value = 0.0;
      udunitString = text;
    }

    DateUnit du;
    try {
      du = new DateUnit(udunitString);
    } catch (Exception e) {
      return null;
    }

    return du.makeDate(value);
  }
static public Date getStandardDate(String text) {
    double value;
    String udunitString;

    text = text.trim();
    StringTokenizer stoker = new StringTokenizer(text);
    String firstToke = stoker.nextToken();
    try {
      value = Double.parseDouble(firstToke);
      udunitString = text.substring(firstToke.length());
    } catch (NumberFormatException e) { // stupid way to test if it starts with a number
      value = 0.0;
      udunitString = text;
    }

    DateUnit du;
    try {
      du = new DateUnit(udunitString);
    } catch (Exception e) {
      return null;
    }

    return du.makeDate(value);
  }
static public Date getStandardDate ( String text ) { double value ; String udunitString ; text = text . trim ( ) ; StringTokenizer stoker = new StringTokenizer ( text ) ; String firstToke = stoker . nextToken ( ) ; try { value = Double . parseDouble ( firstToke ) ; udunitString = text . substring ( firstToke . length ( ) ) ; } catch ( NumberFormatException e ) { // stupid way to test if it starts with a number
 value = 0.0 ; udunitString = text ; } DateUnit du ; try { du = new DateUnit ( udunitString ) ; } catch ( Exception e ) { return null ; } return du . makeDate ( value ) ; }
Create a java.util.Date from this udunits String.

@param text a udunit string.
<pre>[number] (units) since [-]Y[Y[Y[Y]]]-MM-DD[(T| )hh[:mm[:ss[.sss*]]][ [+|-]hh[[:]mm]]]</pre>
@return Date or null if not date unit.
Create a java . util . Date from this udunits String .