/** Converts the given timestamp into a date string with the given format. */ public static String convertDate(long stamp, int format, String outputFormat) { return convertDate(stamp, format, outputFormat, false); }
/** Converts the given timestamp into an ISO8601 date. */ public static String convertDate(long stamp, int format) { return convertDate(stamp, format, ISO8601_FORMAT); }
/** * Converts the given timestamp into an ISO8601 date. * * @param stamp the format-dependent timestamp * @param format the format in which <code>stamp</code> is stored. * This is used to select the epoch value used for normalizing * the timestamp to milliseconds since the UNIX epoch. Valid * values are #UNIX, #COBOL, #MICROSOFT, #ZVI, and #ALT_ZVI. * @return an ISO 8601 formatted timestamp * @see #UNIX_EPOCH * @see #COBOL_EPOCH * @see #MICROSOFT_EPOCH * @see #ZVI_EPOCH * @see #ALT_ZVI_EPOCH */ public static String convertDate(long stamp, int format) { return convertDate(stamp, format, ISO8601_FORMAT); }
/** * Converts the given timestamp into a date string with the given format. * * @param stamp the format-dependent timestamp * @param format the format in which <code>stamp</code> is stored. * This is used to select the epoch value used for normalizing * the timestamp to milliseconds since the UNIX epoch. Valid * values are #UNIX, #COBOL, #MICROSOFT, #ZVI, and #ALT_ZVI. * @param outputFormat the pattern used for formatting the timestamp * @return a timestamp in the specified output format * @see #UNIX_EPOCH * @see #COBOL_EPOCH * @see #MICROSOFT_EPOCH * @see #ZVI_EPOCH * @see #ALT_ZVI_EPOCH * @see DateTimeFormat */ public static String convertDate(long stamp, int format, String outputFormat) { return convertDate(stamp, format, outputFormat, false); }
long stamp = ms + (long) (stamps[timeIndex][i] * 1000); addGlobalMeta(key, DateTools.convertDate(stamp, DateTools.UNIX, DATE_FORMAT));
startTime = DateTools.convertDate(stamp, DateTools.MICROSOFT);
startTime = DateTools.convertDate(stamp, DateTools.MICROSOFT);
stamp = System.currentTimeMillis(); date = DateTools.convertDate(stamp, (int) DateTools.UNIX_EPOCH);
stamp = System.currentTimeMillis(); date = DateTools.convertDate(stamp, (int) DateTools.UNIX_EPOCH);
/** * Sets a default creation date. If the named file exists, then the creation * date is set to the file's last modification date. Otherwise, it is set * to the current date. * * @see #setDefaultDateEnabled(boolean) */ public static void setDefaultCreationDate(MetadataStore store, String id, int series) { if (!defaultDateEnabled) { return; } Location file = id == null ? null : new Location(id).getAbsoluteFile(); long time = System.currentTimeMillis(); if (file != null && file.exists()) time = file.lastModified(); store.setImageAcquisitionDate(new Timestamp(DateTools.convertDate( time, DateTools.UNIX)), series); }
/** * Sets a default creation date. If the named file exists, then the creation * date is set to the file's last modification date. Otherwise, it is set * to the current date. * * @see #setDefaultDateEnabled(boolean) */ public static void setDefaultCreationDate(MetadataStore store, String id, int series) { if (!defaultDateEnabled) { return; } Location file = id == null ? null : new Location(id).getAbsoluteFile(); long time = System.currentTimeMillis(); if (file != null && file.exists()) time = file.lastModified(); store.setImageAcquisitionDate(new Timestamp(DateTools.convertDate( time, DateTools.UNIX)), series); }
stamp = System.currentTimeMillis(); date = DateTools.convertDate(stamp, (int) DateTools.UNIX_EPOCH);
String year = DateTools.convertDate(modTime, DateTools.UNIX, "yyyy"); date = value.replaceAll("'", "") + " " + year; date = DateTools.formatDate(date, DATE_FORMAT);
stamp = System.currentTimeMillis(); date = DateTools.convertDate(stamp, (int) DateTools.UNIX_EPOCH);
Double deltaT; if (t == 0) { String date = DateTools.convertDate(stamp, DateTools.COBOL); if (date != null) { store.setImageAcquisitionDate(new Timestamp(date), 0);
Double deltaT; if (t == 0) { String date = DateTools.convertDate(stamp, DateTools.COBOL); if (date != null) { store.setImageAcquisitionDate(new Timestamp(date), 0);
String stamp = DateTools.convertDate(stampMs, DateTools.UNIX);
String stamp = DateTools.convertDate(stampMs, DateTools.UNIX);
timestamps[seriesIndex] = new String[numStamps]; for (int j=0; j<numStamps; j++) { timestamps[seriesIndex][j] = DateTools.convertDate( DateTools.getTime(getString(64), DATE_FORMAT, ":"), DateTools.UNIX, DATE_FORMAT + ":SSS");
timestamps[seriesIndex] = new String[numStamps]; for (int j=0; j<numStamps; j++) { timestamps[seriesIndex][j] = DateTools.convertDate( DateTools.getTime(getString(64), DATE_FORMAT, ":"), DateTools.UNIX, DATE_FORMAT + ":SSS");