Here you can find the source of dateFromHourAndMinutes(final String pTime)
Parameter | Description |
---|---|
pTime | to convert |
Parameter | Description |
---|---|
ParseException | if the date can not be transformed |
public static Date dateFromHourAndMinutes(final String pTime) throws ParseException
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**/*ww w.ja v a 2 s. c o m*/ * Generate from a date object from a given date-string (HH:mm), like 12:13 * * @param pTime * to convert * @return an date representation of the string * @throws ParseException * if the date can not be transformed */ public static Date dateFromHourAndMinutes(final String pTime) throws ParseException { final SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); return sdf.parse(pTime); } }