gov.nasa.gsfc.drl.rtstps.core.output.hdf5
Class FileCreationDateFormat

java.lang.Object
  extended by gov.nasa.gsfc.drl.rtstps.core.output.hdf5.FileCreationDateFormat

public class FileCreationDateFormat
extends java.lang.Object

Create proper NPOESS filename CreationDate fields, or parse pre-existing ones back into a Date object. Because Java only supports times to milliseconds resolution, the microseconds are not fully reflected. The format is follows: cyyyyMMddHHmmssSSSSSS The subfields are:

yyyy -- yearMM -- monthdd -- day of monthHH -- hour of daymm -- minutes of hourss -- seconds of minutesSSSSSS -- microseconds


Field Summary
private  java.text.SimpleDateFormat sdf
           
 
Constructor Summary
FileCreationDateFormat()
           
 
Method Summary
 java.lang.String format(java.util.Date date)
          Return a CreationDate string in the format: cyyyyMMddHHmmssSSSSSS
 java.util.Date parse(java.lang.String fileCreationDateString)
          Parse a Date object into the NPOESS file CreationDate field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sdf

private java.text.SimpleDateFormat sdf
Constructor Detail

FileCreationDateFormat

public FileCreationDateFormat()
Method Detail

format

public java.lang.String format(java.util.Date date)
Return a CreationDate string in the format: cyyyyMMddHHmmssSSSSSS

Parameters:
date - a Date object
Returns:
the formatted String

parse

public java.util.Date parse(java.lang.String fileCreationDateString)
                     throws RtStpsException
Parse a Date object into the NPOESS file CreationDate field. The field has the format of: cyyyyMMddHHmmssSSSSSS, although a String with the preceding 'c' is accepted as well. The subfields are: yyyy -- yearMM -- monthdd -- day of monthHH -- hour of daymm -- minutes of hourss -- seconds of minutesSSSSSS -- microseconds

Parameters:
fileCreationDateString - the date/time String from the file, may include the preceding 'c' or not
Returns:
the Date object
Throws:
RtStpsException