Java Time to String timeString(double time)

Here you can find the source of timeString(double time)

Description

time String

License

Open Source License

Declaration

public static String timeString(double time) 

Method Source Code


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

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

public class Main {
    public static String timeString(double time) {
        if (Double.isNaN(time)) {
            return "NA";
        }/*from   ww  w  .  j a va2  s.co m*/
        SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
        formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
        long longTime = Math.round(time);
        Date date = new Date(longTime);
        return formatter.format(date);
    }
}

Related

  1. time2string(double t)
  2. time2String(long time)
  3. timesAreEqual(Date date1, Date date2)
  4. timeStr(Date _Date)
  5. timeString()
  6. timeString(long tickNo, long offset)
  7. timeString2Date(String time)
  8. timeToDeparture(String startTime)
  9. timeToFullString(long time)