public static String formatDate(long date) { return formatDate(date, "dd-MMM-yyyy HH:mm:ss"); }
public static String formatDateShort(long date) { return formatDate(date, "MMM dd, HH:mm"); }
public static String formatCustomDateOnly(long date) { if (date == 0) {return "";} return formatDate(date, "dd-MMM-yyyy"); }
public static String formatCustomTimeOnly(long date, boolean with_secs) { if (date == 0) {return "";} return formatDate(date, (with_secs) ? "HH:mm:ss" : "HH:mm"); }
public static String formatCustomDateTime(long date) { if (date == 0) {return "";} return formatDate(date); }
public static String formatDateNum(long date) { return formatDate(date, "yyyy-MM-dd HH:mm:ss"); }
@Override public void refresh(TableCell cell) { TRHostTorrent item = (TRHostTorrent)cell.getDataSource(); String date_text = ""; if( item != null ) { long date = item.getDateAdded(); date_text = DisplayFormatters.formatDate( date ); } cell.setText( date_text ); }
content.append("Created On:\t").append(DisplayFormatters.formatDate(c_date * 1000)).append(NL);
@Override public void cellHover(TableCell cell) { super.cellHover(cell); Object oTooltip = cell.getToolTip(); String s = (oTooltip instanceof String) ? (String) oTooltip + "\n" : ""; DownloadManager dm = (DownloadManager) cell.getDataSource(); long dateAdded = (dm == null) ? 0 : dm.getDownloadState().getLongParameter( DownloadManagerState.PARAM_DOWNLOAD_ADDED_TIME); if (dateAdded != 0) { s += MessageText.getString("TableColumn.header.date_added") + ": " + DisplayFormatters.formatDate(dateAdded) + " (" + DisplayFormatters.formatETA((SystemTime.getCurrentTime() - dateAdded) / 1000, false) + ")"; cell.setToolTip(s); } } }
String creation_date = DisplayFormatters.formatDate(manager.getTorrentCreationDate()*1000); byte[] created_by = torrent == null ? null : torrent.getCreatedBy(); if (created_by != null) {
String creation_date = DisplayFormatters.formatDate(torrent.getCreationDate() * 1000l); ((SWTSkinObjectText) so).setText(creation_date);