DateTimeUtils { public static String toFileNameFormat(Date date) { return FILE_NAME_FORMAT.format(date); }  static Calendar getUtcCalendar(); static Date cfiDateToUtc(int days, long seconds, long microseconds); static Date cfiDateToUtc(CompoundData compoundData); static Date mjdFloatDateToUtc(float mjd); static String toVariableHeaderFormat(Date date); static String toFixedHeaderFormat(Date date); static Date fromFixedHeaderFormat(String dateString); static String toFileNameFormat(Date date);  }
@Test public void testToFileNameFormat() { Date date = DateTimeUtils.cfiDateToUtc(0, 0, 0); String variableHeaderFormat = DateTimeUtils.toFileNameFormat(date); assertEquals("20000101T000000", variableHeaderFormat); date = DateTimeUtils.cfiDateToUtc(1, 0, 0); variableHeaderFormat = DateTimeUtils.toFileNameFormat(date); assertEquals("20000102T000000", variableHeaderFormat); date = DateTimeUtils.cfiDateToUtc(0, 1, 0); variableHeaderFormat = DateTimeUtils.toFileNameFormat(date); assertEquals("20000101T000001", variableHeaderFormat); date = DateTimeUtils.cfiDateToUtc(0, 0, 1000); variableHeaderFormat = DateTimeUtils.toFileNameFormat(date); assertEquals("20000101T000000", variableHeaderFormat); }