Java Utililty Methods Long Number to Date

List of utility methods to do Long Number to Date

Description

The list of methods to do Long Number to Date are organized into topic(s).

Method

StringconvertUNIXTimeToString(long time)
convert UNIX Time To String
DateFormat format = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, Locale.getDefault());
return format.format(new Date(time));
StringdateToAPODString(long date)
date To APOD String
return date_apod.format(date);
longdateToLong(String date)
conversion from date to long value
final SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_PATTERN);
Date fDate = dateFormat.parse(date);
Long lDate = fDate.getTime();
return lDate;
StringdateToPGNDate(long when)
get PGN format of the date (the version in chesspresso.pgn.PGN gets the month wrong :( )
return new SimpleDateFormat("yyyy.MM.dd").format(new Date(when));
StringdateToString(long date)
date To String
return DATE_FORMAT.get().format(new Date(date));
StringdateToString(long date)
date To String
DateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
return df.format(new Date(date));
StringdateToString(long date)
date To String
return dateToString(date, null);
StringdateToString(long date)
Formats millisecond time to string.
return dateToString(new Date(date));
StringdateToString(long date, String formate)
date To String
return dateToString(new Date(date), formate);
StringdateToStrLong(java.util.Date dateDate, String format)
date To Str Long
SimpleDateFormat formatter = new SimpleDateFormat(format);
String dateString = formatter.format(dateDate);
return dateString;