Android Hour Format getDateByAddFltHour(float flt)

Here you can find the source of getDateByAddFltHour(float flt)

Description

get Date By Add Flt Hour

License

Apache License

Declaration

public static String getDateByAddFltHour(float flt) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class Main {

    public static String getDateByAddFltHour(float flt) {
        int addMinute = (int) (flt * 60);
        Calendar cal = new GregorianCalendar();
        cal.setTime(new Date());
        cal.add(GregorianCalendar.MINUTE, addMinute);
        return getFormatDateTime(cal.getTime(), "yyyy-MM-dd HH:mm:ss");
    }//from w  w w . j  a  v  a2 s. c  o m

    public static String getFormatDateTime(Date date, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(date);
    }
}

Related

  1. formatHour(String string)
  2. formatHour(int val)
  3. getReminderReadableTime(int hour, int minute)
  4. getCurrentHour()
  5. getDateByAddHour(String datetime, int minute)
  6. homiToString(int hour, int minute)
  7. formatElapsedTime(StringBuilder recycle, String format, long hours, long minutes, long seconds)
  8. time2String(int hour, int minute)