java.time.OffsetDateTime.getMinute()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(149)

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

OffsetDateTime.getMinute介绍

[英]Gets the minute-of-hour field.
[中]获取小时分钟字段。

代码示例

代码示例来源:origin: org.assertj/assertj-core

/**
 * Returns true if both OffsetDateTime are in the same year, month, day of month, hour and minute, false otherwise.
 *
 * @param actual the actual OffsetDateTime. expected not be null
 * @param other the other OffsetDateTime. expected not be null
 * @return true if both OffsetDateTime are in the same year, month, day of month, hour and minute, false otherwise.
 */
private static boolean areEqualIgnoringSeconds(OffsetDateTime actual, OffsetDateTime other) {
 return areEqualIgnoringMinutes(actual, other) && actual.getMinute() == other.getMinute();
}

代码示例来源:origin: joel-costigliola/assertj-core

/**
 * Returns true if both OffsetDateTime are in the same year, month, day of month, hour and minute, false otherwise.
 *
 * @param actual the actual OffsetDateTime. expected not be null
 * @param other the other OffsetDateTime. expected not be null
 * @return true if both OffsetDateTime are in the same year, month, day of month, hour and minute, false otherwise.
 */
private static boolean areEqualIgnoringSeconds(OffsetDateTime actual, OffsetDateTime other) {
 return areEqualIgnoringMinutes(actual, other) && actual.getMinute() == other.getMinute();
}

代码示例来源:origin: google/data-transfer-project

@SuppressWarnings("unchecked")
@Test
public void testTransform() throws IOException {
 context.setProperty(CALENDAR_ID, "123");
 Map<String, Object> rawEvent = mapper.readValue(SAMPLE_CALENDAR_EVENT, Map.class);
 CalendarEventModel event = transformer.apply(rawEvent, context);
 Assert.assertEquals("123", event.getCalendarId());
 Assert.assertEquals("Some Place", event.getLocation());
 Assert.assertEquals("Test Appointment 1", event.getTitle());
 Assert.assertTrue(event.getNotes().length() > 5);
 Assert.assertEquals(1, event.getAttendees().size());
 CalendarAttendeeModel attendee = event.getAttendees().get(0);
 Assert.assertEquals("Test Test1", attendee.getDisplayName());
 Assert.assertEquals("foo@foo.com", attendee.getEmail());
 Assert.assertFalse(attendee.getOptional());
 Assert.assertEquals(18, event.getStartTime().getDateTime().getHour());
 Assert.assertEquals(0, event.getStartTime().getDateTime().getMinute());
 Assert.assertEquals(18, event.getEndTime().getDateTime().getHour());
 Assert.assertEquals(30, event.getEndTime().getDateTime().getMinute());
}

代码示例来源:origin: debezium/debezium

assertThat(c4DateTime.getMinute()).isEqualTo(0);
assertThat(c4DateTime.getSecond()).isEqualTo(0);
assertThat(c4DateTime.getNano()).isEqualTo(0);

代码示例来源:origin: avaire/avaire

/**
 * Creates a new Carbon instance from the provided offset date time object.
 *
 * @param offsetDateTime The offset date time that the Carbon instance should be created from.
 * @return a Carbon instance with the provided date and time.
 */
public static Carbon createFromOffsetDateTime(OffsetDateTime offsetDateTime) {
  return Carbon.create(
    offsetDateTime.getYear(),
    offsetDateTime.getMonthValue(),
    offsetDateTime.getDayOfMonth(),
    offsetDateTime.getHour(),
    offsetDateTime.getMinute(),
    offsetDateTime.getSecond()
  );
}

代码示例来源:origin: rocks.xmpp/xmpp-extensions-common

/**
 * Creates a date value.
 *
 * @param date The date value.
 */
private Value(OffsetDateTime date) {
  XMLGregorianCalendar xmlGregorianCalendar;
  try {
    xmlGregorianCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar();
    xmlGregorianCalendar.setYear(date.getYear());
    xmlGregorianCalendar.setMonth(date.getMonth().getValue());
    xmlGregorianCalendar.setDay(date.getDayOfMonth());
    xmlGregorianCalendar.setTime(date.getHour(), date.getMinute(), date.getSecond()); // date.get(ChronoField.MILLI_OF_SECOND)
    xmlGregorianCalendar.setTimezone(date.getOffset().getTotalSeconds() / 60);
  } catch (DatatypeConfigurationException e) {
    xmlGregorianCalendar = null;
  }
  this.value = xmlGregorianCalendar;
}

代码示例来源:origin: hprose/hprose-java

@Override
  public final void serialize(Writer writer, OffsetDateTime datetime) throws IOException {
    super.serialize(writer, datetime);
    OutputStream stream = writer.stream;
    if (!(datetime.getOffset().equals(ZoneOffset.UTC))) {
      stream.write(TagString);
      ValueWriter.write(stream, datetime.toString());
    }
    else {
      int year = datetime.getYear();
      if (year > 9999 || year < 1) {
        stream.write(TagString);
        ValueWriter.write(stream, datetime.toString());
      }
      else {
        ValueWriter.writeDate(stream, year, datetime.getMonthValue(), datetime.getDayOfMonth());
        ValueWriter.writeTime(stream, datetime.getHour(), datetime.getMinute(), datetime.getSecond(), 0, false, true);
        ValueWriter.writeNano(stream, datetime.getNano());
        stream.write(TagUTC);
      }
    }
  }
}

代码示例来源:origin: org.hprose/hprose-java

@Override
  public final void serialize(Writer writer, OffsetDateTime datetime) throws IOException {
    super.serialize(writer, datetime);
    OutputStream stream = writer.stream;
    if (!(datetime.getOffset().equals(ZoneOffset.UTC))) {
      stream.write(TagString);
      ValueWriter.write(stream, datetime.toString());
    }
    else {
      int year = datetime.getYear();
      if (year > 9999 || year < 1) {
        stream.write(TagString);
        ValueWriter.write(stream, datetime.toString());
      }
      else {
        ValueWriter.writeDate(stream, year, datetime.getMonthValue(), datetime.getDayOfMonth());
        ValueWriter.writeTime(stream, datetime.getHour(), datetime.getMinute(), datetime.getSecond(), 0, false, true);
        ValueWriter.writeNano(stream, datetime.getNano());
        stream.write(TagUTC);
      }
    }
  }
}

代码示例来源:origin: ngs-doo/dsl-json

NumberConverter.write2(value.getHour(), buf, pos + 12);
buf[pos + 14] = ':';
NumberConverter.write2(value.getMinute(), buf, pos + 15);
buf[pos + 17] = ':';
NumberConverter.write2(value.getSecond(), buf, pos + 18);

代码示例来源:origin: io.debezium/debezium-connector-mysql

assertThat(c4DateTime.getMinute()).isEqualTo(0);
assertThat(c4DateTime.getSecond()).isEqualTo(0);
assertThat(c4DateTime.getNano()).isEqualTo(0);

相关文章