Java Time to String timeString()

Here you can find the source of timeString()

Description

time String

License

Open Source License

Declaration

public static String timeString() 

Method Source Code


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

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

public class Main {
    public static final SimpleDateFormat FORMATTER = new SimpleDateFormat("HH:mm:ss");

    public static String timeString() {
        return timestampToString(System.currentTimeMillis());
    }//ww w  . ja  v a  2  s  .c o m

    public static String timestampToString(long timestamp) {
        return FORMATTER.format(new Date(timestamp));
    }
}

Related

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