cdm/src/main/java/ucar/nc2/units/DateFromString.java
public static Date getDateUsingDemarkatedCount( String dateString, String dateFormatString, char demark )
  {
    // the position of the demark char is where to start parsing the dateString
    int pos1 = dateFormatString.indexOf( demark);

    // the rest of the dateFormatString is the SimpleDateFormat
    dateFormatString = dateFormatString.substring( pos1+1);

    return getDateUsingCompleteDateFormatWithOffset( dateString, dateFormatString, pos1 );
  }
public static Date getDateUsingDemarkatedCount( String dateString, String dateFormatString, char demark )
  {
    // the position of the demark char is where to start parsing the dateString
    int pos1 = dateFormatString.indexOf( demark);

    // the rest of the dateFormatString is the SimpleDateFormat
    dateFormatString = dateFormatString.substring( pos1+1);

    return getDateUsingCompleteDateFormatWithOffset( dateString, dateFormatString, pos1 );
  }
public static Date getDateUsingDemarkatedCount ( String dateString , String dateFormatString , char demark ) { // the position of the demark char is where to start parsing the dateString int pos1 = dateFormatString . indexOf ( demark ) ; // the rest of the dateFormatString is the SimpleDateFormat dateFormatString = dateFormatString . substring ( pos1 + 1 ) ; return getDateUsingCompleteDateFormatWithOffset ( dateString , dateFormatString , pos1 ) ; }
Parse the given date string, starting at a position given by the offset of the demark character in the dateFormatString.
The rest of the dateFormatString is the date format string (as described in java.text.SimpleDateFormat).
<pre> Example:
dateString =        wrfout_d01_2006-07-06_080000.nc
dateFormatString = wrfout_d01_#yyyy-MM-dd_HHmm
</pre>
This simply counts over "wrfout_d01_" number of chars in dateString, then applies the remaining dateFormatString.

@param dateString the String to be parsed
@param dateFormatString the date format String
@param demark the demarkation character
@return the Date that was parsed.
Parse the given date string starting at a position given by the offset of the demark character in the dateFormatString . The rest of the dateFormatString is the date format string ( as described in java . text . SimpleDateFormat ) . <pre > Example : dateString = wrfout_d01_2006 - 07 - 06_080000 . nc dateFormatString = wrfout_d01_#yyyy - MM - dd_HHmm < / pre > This simply counts over wrfout_d01_ number of chars in dateString then applies the remaining dateFormatString .