gov.nasa.gsfc.drl.rtstps.core.output.hdf5
Class FileCreationDateFormat
java.lang.Object
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 -- year
MM -- month
dd -- day of month
HH -- hour of day
mm -- minutes of hour
ss -- seconds of minutes
SSSSSS -- microseconds
Field Summary |
private java.text.SimpleDateFormat |
sdf
|
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 |
sdf
private java.text.SimpleDateFormat sdf
FileCreationDateFormat
public FileCreationDateFormat()
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 -- year
MM -- month
dd -- day of month
HH -- hour of day
mm -- minutes of hour
ss -- seconds of minutes
SSSSSS -- microseconds
- Parameters:
fileCreationDateString
- the date/time String from the file, may include the preceding 'c' or not
- Returns:
- the Date object
- Throws:
RtStpsException