Java Long Number to Time convertTimeToString(final long timeInMillis)

Here you can find the source of convertTimeToString(final long timeInMillis)

Description

convert Time To String

License

Open Source License

Return

zeit als String in der Form HH:mm:ss

Declaration

public static String convertTimeToString(final long timeInMillis) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;
import java.util.Calendar;

import java.util.Locale;
import java.util.TimeZone;

public class Main {
    private static final String TIME_FORMAT_PATTERN = "HH:mm:ss";

    /**/*from   w  ww.  j ava2s.c om*/
     * @return zeit als String in der Form HH:mm:ss
     */
    public static String convertTimeToString(final long timeInMillis) {
        final Calendar calendar = Calendar.getInstance(Locale.GERMAN);
        calendar.setTimeInMillis(timeInMillis);
        final SimpleDateFormat format = new SimpleDateFormat(TIME_FORMAT_PATTERN);
        format.setTimeZone(TimeZone.getTimeZone("GMT+0")); //$NON-NLS-1$
        return format.format(calendar.getTime());
    }
}

Related

  1. convertLong2String(Long time, String format)
  2. convertLongDate(long lDate, String format)
  3. convertLongTimeStampToString(long localTimeStamp)
  4. ConvertLongToTimeString(long lastModified)
  5. convertTime(long time)
  6. convertTime(long value)
  7. convertTimestampToUTCString(final long aTimestamp)
  8. convertUnixTime(long unixtime)
  9. convertUnixTimeStampToMySql(long timestamp)