Java Utililty Methods Time to String

List of utility methods to do Time to String

Description

The list of methods to do Time to String are organized into topic(s).

Method

StringtimeToFullString(long time)
time To Full String
String returnTime = "";
long temp;
if (time / ONE_WEEK_IN_MILISECONDS > 0) {
    temp = time / ONE_WEEK_IN_MILISECONDS;
    String week = (temp > 1) ? temp + " weeks " : temp + " week ";
    returnTime += week;
    temp = (time - temp * ONE_WEEK_IN_MILISECONDS) / ONE_DAY_IN_MILISECONDS;
    String day = (temp > 1) ? temp + " days " : temp + " day ";
...
StringtimeToFullString(long time, boolean longNames)
time To Full String
long s, m, h, d, w;
String line = "", _s = "s ", _m = "m ", _h = "h ", _d = "d ", _w = "w ", clock = "%d%s";
if (longNames) {
    _s = " second(s) ";
    _m = " minute(s) ";
    _h = " hour(s) ";
    _d = " day(s) ";
    _w = " week(s) ";
...
StringtimeToStr(int time)
time To Str
return new SimpleDateFormat(STAND_DATE_TIME).format(new Date(time * 1000L));
StringtimeToStr(String time)
time To Str
char[] timeArray = time.toCharArray();
char[] timeList = new char[timeArray.length];
int j = 0;
for (int i = 0; i < timeArray.length; i++) {
    if (timeArray[i] == '-' || timeArray[i] == ' ' || timeArray[i] == ':') {
        continue;
    } else {
        timeList[j] = timeArray[i];
...
StringtimeToString(Calendar date)
time To String
return dateToString(date, FORMAT_TIME);
StringtimeToString(Date d, String tzString)
time To String
DateFormat df = (DateFormat) DateFormat.getTimeInstance(DateFormat.SHORT).clone();
if (tzString != null)
    df.setTimeZone(TimeZone.getTimeZone(tzString));
return df.format(d);
StringtimeToString(Date date)
time To String
SimpleDateFormat sdf = new SimpleDateFormat(TIME_PARTTEN);
return sdf.format(date);
StringtimeToString(double d)
time To String
if (d == NO_DATA_D) {
    return "No Data";
} else {
    int minutes = ((int) d) / 60;
    int seconds = ((int) d) - (minutes * 60);
    return String.valueOf(minutes) + ":" + String.valueOf(seconds);
StringtimeToString(double time, boolean longNames)
time To String
String error = NEGATIVE, clock = "%.2f%s";
String _s = "s", _m = "m", _h = "h", _d = "d", _w = "w";
if (longNames) {
    _s = " second(s)";
    _m = " minute(s)";
    _h = " hour(s)";
    _d = " day(s)";
    _w = " week(s)";
...
StringtimeToString(final Date date)
Time to string.
String result = "";
result = TIME.format(date);
return result;