Java Time to String timeToString(java.util.Date date)

Here you can find the source of timeToString(java.util.Date date)

Description

time To String

License

Open Source License

Declaration

public static String timeToString(java.util.Date date) 

Method Source Code

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

import java.text.SimpleDateFormat;

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

    public static String timeToString(java.util.Date date) {
        try {//  w  w  w .  ja v a2s . c  o  m
            return ((date == null) ? "" : getTimeFormatter().format(date));
        } catch (Exception e) {
            return "";
        }
    }

    public static SimpleDateFormat getTimeFormatter() {
        return new SimpleDateFormat(TIME_FORMAT); // m_timeFormatter;
    }
}

Related

  1. timeToString(int s)
  2. timeToString(int time)
  3. timeToString(int time)
  4. timeToString(int time)
  5. TimeToString(int time)
  6. timeToString(long time)
  7. timeToString(long time)
  8. timeToString(long time)
  9. timeToString(long time)