java.util.Date.setMinutes()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(189)

本文整理了Java中java.util.Date.setMinutes()方法的一些代码示例,展示了Date.setMinutes()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Date.setMinutes()方法的具体详情如下:
包路径:java.util.Date
类名称:Date
方法名:setMinutes

Date.setMinutes介绍

[英]Sets the gregorian calendar minute of the hour for this Date object.
[中]设置此日期对象的公历小时分钟数。

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

@Override
public void setMinutes(int minutes) {
 checkFrozen();
 super.setMinutes(minutes);
}

代码示例来源:origin: tianshaojie/AndroidFine

public static String getSimpleTimeString(long time) {
  String strTemp = "";
  Date dateCreate = new Date(time);
  Date dateNow = new Date();
  dateNow.setHours(0);
  dateNow.setMinutes(0);
  dateNow.setSeconds(0);
  if (dateCreate.before(dateNow)) {
    SimpleDateFormat myFmt2 = new SimpleDateFormat("MM-dd");
    myFmt2.setTimeZone(TimeZone.getDefault());
    strTemp = myFmt2.format(dateCreate);
  } else {
    SimpleDateFormat myFmt2 = new SimpleDateFormat("HH:mm");
    myFmt2.setTimeZone(TimeZone.getDefault());
    strTemp = myFmt2.format(dateCreate);
  }
  return strTemp;
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Resets the date to have no time modifiers. Note that the hour might not be zero if the time
 * hits a DST transition date.
 *
 * @param date the date
 */
@SuppressWarnings("deprecation") // GWT requires Date
public static void resetTime(Date date) {
 long msec = resetMilliseconds(date.getTime());
 date.setTime(msec);
 date.setHours(0);
 date.setMinutes(0);
 date.setSeconds(0);
}

代码示例来源:origin: stackoverflow.com

date2am.setMinutes(ZERO_MINUTES);

代码示例来源:origin: com.google.gwt/gwt-servlet

date.setMinutes(this.minutes);

代码示例来源:origin: naver/ngrinder

@SuppressWarnings("deprecation")
@Test
public void testCompareDateEndWithMinute() {
  Date date1 = new Date();
  date1.setSeconds(0);
  Date date2 = new Date(date1.getTime());
  date2.setSeconds(10);
  assertTrue(DateUtils.compareDateEndWithMinute(date1, date2));
  assertTrue(DateUtils.compareDateEndWithMinute(date1, date1));
  date2 = new Date(date1.getTime());
  if (date1.getMinutes() > 1) {
    date2.setMinutes(date1.getMinutes() - 1);
  } else {
    date2.setMinutes(date1.getMinutes() + 1);
  }
  assertTrue(!DateUtils.compareDateEndWithMinute(date1, date2));
}

代码示例来源:origin: com.google.web.bindery/requestfactory-server

@Override
public void setMinutes(int minutes) {
 checkFrozen();
 super.setMinutes(minutes);
}

代码示例来源:origin: net.wetheinter/gwt-user

@Override
public void setMinutes(int minutes) {
 checkFrozen();
 super.setMinutes(minutes);
}

代码示例来源:origin: stackoverflow.com

AlarmManager am = (AlarmManager) con.getSystemService(Context.ALARM_SERVICE);

Date futureDate = new Date(new Date().getTime() + 86400000);

futureDate.setHours(8);
futureDate.setMinutes(0);
futureDate.setSeconds(0);

Intent intent = new Intent(con, MyAppReciever.class);

PendingIntent sender = PendingIntent.getBroadcast(con, 0, intent,
    PendingIntent.FLAG_UPDATE_CURRENT);

代码示例来源:origin: stackoverflow.com

AlarmManager am = (AlarmManager) ct.getSystemService(Context.ALARM_SERVICE);         
Intent intent1 = new Intent(ct, TimeAlarm.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(ct, 0,intent1, PendingIntent.FLAG_CANCEL_CURRENT);

Date curr=new Date();
curr.setHours(h);
curr.setMinutes(m);
c.setTime(curr);
c.set(Calendar.SECOND, 0);

Calendar c1 = Calendar.getInstance();
am.setRepeating(AlarmManager.RTC_WAKEUP, c.getTimeInMillis(),24*60*60*1000, pendingIntent);

代码示例来源:origin: stackoverflow.com

Date midnight = new Date();
midnight.setHours(0);
midnight.setMinutes(0);
midnight.setSeconds(0);

Date elevenfiftynine = new Date();
elevenfiftynine.setHours(23);
elevenfiftynine.setMinutes(59);
elevenfiftynine.setSeconds(59);

query.whereGreaterThan(Constants.CREATED_AT_KEY, midnight);
query.whereLessThan(Constants.CREATED_AT_KEY, elevenfiftynine);

代码示例来源:origin: stackoverflow.com

boolean isBeforeToday(Date d) {
   Date today = new Date();
   today.setHours(0);
   today.setMinutes(0);
   today.setSeconds(0);
   return d.before(today);
 }

代码示例来源:origin: EvoSuite/evosuite

@SuppressWarnings("deprecation")
public void setMinutes(int minutes) {
  Capturer.capture(Instrumenter.CAPTURE_ID_JAVA_UTIL_DATE, this, "setMinutes", "(I)V", new Object[] {minutes});
  super.setMinutes(minutes);
  Capturer.enable(Instrumenter.CAPTURE_ID_JAVA_UTIL_DATE, this, CaptureLog.RETURN_TYPE_VOID);
}

代码示例来源:origin: protegeproject/webprotege

/**
 * Taken from {@link com.google.gwt.user.datepicker.client.CalendarUtil}
 */
private static void resetTime(Date date) {
  long msec = resetMilliseconds(date.getTime());
  date.setTime(msec);
  date.setHours(0);
  date.setMinutes(0);
  date.setSeconds(0);
}

代码示例来源:origin: stackoverflow.com

AlarmManager am = (AlarmManager) con
     .getSystemService(Context.ALARM_SERVICE);
 Date futureDate = new Date(new Date().getTime() + 86400000);
 futureDate.setHours(8);
 futureDate.setMinutes(0);
 futureDate.setSeconds(0);
 Intent intent = new Intent(con, MyAppReciever.class);
 PendingIntent sender = PendingIntent.getBroadcast(con, 0, intent,
     PendingIntent.FLAG_UPDATE_CURRENT);
 am.set(AlarmManager.RTC_WAKEUP, futureDate.getTimeInMillis(), sender);

代码示例来源:origin: oVirt/ovirt-engine

private Date getExecutionTimeValue(GlusterVolumeSnapshotSchedule schedule) {
    Date dt = new Date();
    dt.setHours(schedule.getExecutionTime().getHours());
    dt.setMinutes(schedule.getExecutionTime().getMinutes());
    return dt;
  }
}),

代码示例来源:origin: org.openmuc/openiec61850

@SuppressWarnings("deprecation")
  @Override
  protected void writeImpl() {
    Date newDate = dateChooser.getDate();
    Date timeValues = (Date) timeSpinner.getValue();
    newDate.setHours(timeValues.getHours());
    newDate.setMinutes(timeValues.getMinutes());
    newDate.setSeconds(timeValues.getSeconds());
    data.setDate(newDate);
  }
}

代码示例来源:origin: com.vaadin.addon/vaadin-touchkit-agpl

@SuppressWarnings("deprecation")
protected Date trySetTimeFromTimeBoxText(Date value) {
  try {
    Date time = timeOnlyFormat.parse(timeBox.getText());
    value.setHours(time.getHours());
    value.setMinutes(time.getMinutes());
  } catch (IllegalArgumentException e) {
    // Couldn't parse hours, just ignore them and use the old,
    // unmodified value.
  }
  return value;
}

代码示例来源:origin: org.dashbuilder/dashbuilder-dataset-api

@Before
public void setUp() throws Exception {
  Date startTime = new Date();
  startTime.setYear(115);
  startTime.setMonth(10);
  startTime.setDate(10);
  startTime.setHours(12);
  startTime.setMinutes(50);
  startTime.setSeconds(30);
  TimeInstant.START_TIME = startTime;
}

代码示例来源:origin: org.kie.soup/kie-soup-dataset-api

@Before
public void setUp() throws Exception {
  Date startTime = new Date();
  startTime.setYear(115);
  startTime.setMonth(10);
  startTime.setDate(10);
  startTime.setHours(12);
  startTime.setMinutes(50);
  startTime.setSeconds(30);
  TimeInstant.START_TIME = startTime;
}

相关文章