Here you can find the source of addTime(Date date, String time)
Parameter | Description |
---|---|
date | a parameter |
time | a parameter |
@Deprecated public static Date addTime(Date date, String time)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { /**// www.j a v a 2 s .co m * Deprecated! * * @param date * @param time * @return */ @Deprecated public static Date addTime(Date date, String time) { // TODO: Bu method ortak sinif'a gore duzenlenecek int hour = Integer.parseInt(time.substring(0, 2)); int minute = Integer.parseInt(time.substring(2, 4)); int second = Integer.parseInt(time.substring(4, 6)); GregorianCalendar calendar = new GregorianCalendar(); calendar.setTime(date); calendar.set(Calendar.HOUR, hour); calendar.set(Calendar.MINUTE, minute); calendar.set(Calendar.SECOND, second); return calendar.getTime(); } }