Java SQL Time Create getTimeStr(Time time)

Here you can find the source of getTimeStr(Time time)

Description

get Time Str

License

Open Source License

Declaration

static public String getTimeStr(Time time) 

Method Source Code


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

import java.sql.Time;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    /**//from  w ww.  j a v a 2 s . c  o m
     * format pattern : HH:mm:ss
     */
    public static final SimpleDateFormat FORMAT_HMS = new SimpleDateFormat("HH:mm:ss");

    static public String getTimeStr(Time time) {
        return FORMAT_HMS.format(time);
    }

    static public String format(Date date, String formatText) throws Exception {
        SimpleDateFormat format = new SimpleDateFormat(formatText);
        return format.format(date);
    }
}

Related

  1. getTimeFromCalendar(final Calendar calendar)
  2. getTimeList(ResultSet resultSet, String columnName)
  3. getTimeLong(ResultSet resultSet)
  4. getTimeNumberFromSqlTime(Time time)
  5. getTimesByStr(String dataStr)
  6. getTimeZone(String id)
  7. getTimeZone(String timezone, String time, DateFormat format)
  8. getTodayAndTime()
  9. getTomorrowOrderTime()