Here you can find the source of timeToString(Time time)
Parameter | Description |
---|---|
time | a <code>Time</code> value |
String
value
public static String timeToString(Time time)
//package com.java2s; /*// w w w . j a va2 s .co m * Copyright (c) Open Source Strategies, Inc. * * Opentaps is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Opentaps is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with Opentaps. If not, see <http://www.gnu.org/licenses/>. */ import java.sql.Time; import java.text.DateFormat; import java.text.SimpleDateFormat; public class Main { private static final String TIME_FORMAT = "HH:mm:ss"; /** * Returns the time string of time value. * @param time a <code>Time</code> value * @return a <code>String</code> value */ public static String timeToString(Time time) { DateFormat df = new SimpleDateFormat(TIME_FORMAT); return df.format(time); } }