Java SQL Time minutesToTime(int minutes)

Here you can find the source of minutesToTime(int minutes)

Description

minutes To Time

License

Open Source License

Declaration

public static Time minutesToTime(int minutes) 

Method Source Code


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

import java.sql.Time;

public class Main {
    public static Time minutesToTime(int minutes) {
        int hr = getHours(minutes);
        int minute = getMinutes(minutes);

        return hmsToTime(hr, minute, 0);
    }//from   ww w  .  j ava 2 s .c om

    public static int getHours(int minutes) {
        int hr = minutes / 60;

        return hr;
    }

    public static int getMinutes(int minutes) {
        int minute = minutes % 60;

        return minute;
    }

    public static Time hmsToTime(int hh, int mm, int ss) {
        long theLongTime = (hh * 3600) + (mm * 60) + ss;
        Time theTime = new Time(theLongTime);

        return theTime;
    }
}

Related

  1. isTime(String val)
  2. isTimeInRange(java.sql.Time start, java.sql.Time end, java.util.Date d)
  3. merge(java.util.Date date, java.util.Date time)
  4. mergeDateTime(Date date, Time time)
  5. minTime()
  6. parse(String dateTimeString)
  7. parseAMPMFormat(String datetimeString)
  8. parseCalendar(final TimeZone timezone, final Locale locale, final String dateformat, final String datestring)
  9. parseDate(String datetime, String format)