Example usage for java.util Date setMinutes

List of usage examples for java.util Date setMinutes

Introduction

In this page you can find the example usage for java.util Date setMinutes.

Prototype

@Deprecated
public void setMinutes(int minutes) 

Source Link

Document

Sets the minutes of this Date object to the specified value.

Usage

From source file:com.sccl.attech.common.utils.DateUtils.java

/**
 * ??   //from  ww w  .j  ava 2 s. c  o m
 * @param date
 * @return
 */
public static Date getNextDayTime(Date pointDate) {
    Date date = new Date();
    date = getNextDay(date);
    if (pointDate != null) {
        int hours = getHours(pointDate);
        int minutes = getMin(pointDate);
        date.setHours(hours);
        date.setMinutes(minutes);
    }
    return date;
}

From source file:com.opendesign.utils.Day.java

@SuppressWarnings("deprecation")
public static String addMinutes(String dateTime, int min) {

    Date date = getDateWithTyphoonFormatString(dateTime);
    date.setMinutes(date.getMinutes() + min);

    return Day.toStringAsyyyyMMddHHmmss(date.getTime());

}

From source file:org.teleportr.plugin.BahnDePlugIn.java

private Date parseDate(String hours, String minutes) {
    Date date = new Date();
    date.setHours(Integer.parseInt(hours));
    date.setMinutes(Integer.parseInt(minutes));
    date.setSeconds(0);//from ww w.j  ava2s.co m
    //date.setTime((date.getTime() / 1000) * 1000);
    if (System.currentTimeMillis() - date.getTime() > 300000) { // Mitternacht..
        long oneDay = (long) 1000.0 * 60 * 60 * 24;
        date.setTime(date.getTime() + oneDay);
    }
    return date;
}

From source file:th.co.geniustree.dental.controller.AppointmentController.java

@RequestMapping(value = "/appointnontification", method = RequestMethod.GET)
private Page<Appointment> getAppointmentNontification(Pageable pageable) {
    Date d = new Date();
    d.setHours(0);//from  w w w.j a v a2  s.  c om
    d.setMinutes(0);
    Date tomorrow = new Date(d.getTime() + (60 * 60 * 24 * 1000));
    return appointmentRepo.findByAppointDay(tomorrow, pageable);
}

From source file:th.co.geniustree.dental.controller.AppointmentController.java

@RequestMapping(value = "/appointmentnontificationcountnotcontact", method = RequestMethod.GET)
private Long appointmentNontificationCountNotContact() {
    Date d = new Date();
    d.setHours(0);//from w  ww.  jav a  2  s.  co m
    d.setMinutes(0);
    Date tomorrow = new Date(d.getTime() + (60 * 60 * 24 * 1000));
    long count = 0;
    count = appointmentRepo.findByAppointDayAndStatus(tomorrow, "1").size();
    return count;
}

From source file:br.com.hslife.orcamento.service.AgendaService.java

@SuppressWarnings("deprecation")
@Override//from w w  w.j a  va  2s . co  m
public Long contarAgendamentosDeHojeComAlerta() {
    Date inicio = new Date();
    inicio.setHours(0);
    inicio.setMinutes(0);
    inicio.setSeconds(0);

    Date fim = new Date(inicio.getTime());
    fim.setHours(23);
    fim.setMinutes(59);
    fim.setSeconds(59);
    return getRepository().countAgendamentoByDataInicioOrDataFimAndAlerta(inicio, fim, true,
            getUsuarioComponent().getUsuarioLogado());
}

From source file:br.com.hslife.orcamento.service.AgendaService.java

@SuppressWarnings("deprecation")
public List<Agenda> buscarAgendamentosDoDia() {
    CriterioAgendamento criterioBusca = new CriterioAgendamento();
    Date inicio = new Date();
    inicio.setHours(0);// w  w  w  .j  a  v a2  s.c o  m
    inicio.setMinutes(0);
    inicio.setSeconds(0);

    Date fim = new Date(inicio.getTime());
    fim.setHours(23);
    fim.setMinutes(59);
    fim.setSeconds(59);
    criterioBusca.setInicio(inicio);
    criterioBusca.setFim(fim);
    criterioBusca.setUsuario(getUsuarioComponent().getUsuarioLogado());
    return getRepository().findByCriterioAgendamento(criterioBusca);
}

From source file:com.android.applications.todoist.containers.Tasks.java

public ArrayList<Task> getOverdueTasks() {
    ArrayList<Task> list = new ArrayList<Task>();
    int size = this.tasks.size();
    Date today = new Date();
    today.setSeconds(0);// w  w w  . j av  a2  s.  c o m
    today.setMinutes(0);
    today.setHours(0);

    for (int i = 0; i < size; i++) {
        if (this.tasks.get(i).getDueDate().before(today)) {
            list.add(this.tasks.get(i));
        }
    }

    return list;
}

From source file:th.co.geniustree.dental.controller.AppointmentController.java

@RequestMapping(value = "/appointmentnontificationcount", method = RequestMethod.GET)
private Long appointmentNontificationCount(Pageable pageable) {
    Date d = new Date();
    d.setHours(0);//from  ww w .j  a  va2 s .  c o m
    d.setMinutes(0);
    Date tomorrow = new Date(d.getTime() + (60 * 60 * 24 * 1000));
    long count = 0;
    count = appointmentRepo.findByAppointDayAndStatus(tomorrow, "1").size();

    //        List<Appointment> listAppointment = appointmentRepo.findByStatus("2");
    //        for (int i = 0; i < listAppointment.size(); i++) {
    //            Appointment appointment = new Appointment();
    //            appointment = listAppointment.get(i);
    //            SimpleDateFormat dateFormat = new SimpleDateFormat("D");
    //            if (((Integer.parseInt(dateFormat.format(appointment.getAppointDay())) - Integer.parseInt(dateFormat.format(new Date()))) == 1) && ((!"0".equals(appointment.getStatus())))) {
    //                appointment.setStatus("1");
    //                appointmentRepo.save(appointment);
    //                count++;
    //            } else {
    //                appointment.setStatus("2");
    //                appointmentRepo.save(appointment);
    //            }
    //        }
    return count;
}

From source file:org.apache.hadoop.hive.ql.udf.UDFNextDay.java

public String evaluate(String date, Integer day) {
    if (date == null || day == null) {
        return null;
    }/*from w w w.  j av a 2  s . co m*/

    if (day < 1 || day > 7) {
        return null;
    }

    Pattern pattern = Pattern.compile("([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])[\\s\\S]*(\\..*)?$");

    Matcher matcher = pattern.matcher(date);

    if (!matcher.matches()) {
        return null;
    }

    int year = Integer.valueOf(matcher.group(1));
    int month = Integer.valueOf(matcher.group(2));
    int dd = Integer.valueOf(matcher.group(3));

    Date ret = new Date();
    ret.setYear(year - 1900);
    ret.setMonth(month - 1);
    ret.setDate(dd);

    ret.setHours(0);
    ret.setMinutes(0);
    ret.setSeconds(0);

    Calendar curr = Calendar.getInstance();
    curr.setTime(ret);

    int curr_week = curr.get(Calendar.DAY_OF_WEEK);
    int offset = 7 + (day - curr_week);

    curr.add(Calendar.DAY_OF_WEEK, offset);

    Date newDate = curr.getTime();
    System.out.println("newDate:" + newDate.toString());

    year = curr.get(Calendar.YEAR);
    month = curr.get(Calendar.MONTH) + 1;
    dd = curr.get(Calendar.DAY_OF_MONTH);

    System.out.println("curr.get(Calendar.MONTH):" + curr.get(Calendar.MONTH));

    return String.format("%04d-%02d-%02d", year, month, dd);
}