當前位置: 首頁>>代碼示例>>Java>>正文


Java ZonedDateTime.getMinute方法代碼示例

本文整理匯總了Java中java.time.ZonedDateTime.getMinute方法的典型用法代碼示例。如果您正苦於以下問題:Java ZonedDateTime.getMinute方法的具體用法?Java ZonedDateTime.getMinute怎麽用?Java ZonedDateTime.getMinute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.time.ZonedDateTime的用法示例。


在下文中一共展示了ZonedDateTime.getMinute方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getTime

import java.time.ZonedDateTime; //導入方法依賴的package包/類
@Override
public long getTime() {
  ZonedDateTime time = stopWatch.getTime();
  long mSecs = ((time.getDayOfMonth() - 1) * 86400 + time.getHour() * 3600
      + time.getMinute() * 60 + time.getSecond()) * 1000
      + time.getNano() / 1000000;
  /*
   * int offset=time.getOffset().getTotalSeconds();
   * System.out.println(" d:"+(time.getDayOfMonth()-1));
   * System.out.println(" h:"+time.getHour());
   * System.out.println(" m:"+time.getMinute());
   * System.out.println(" s:"+time.getSecond());
   * System.out.println(" n:"+time.getNano());
   * System.out.println(" o:"+offset); System.out.println("ms:"+mSecs);
   */
  return mSecs;
}
 
開發者ID:BITPlan,項目名稱:can4eve,代碼行數:18,代碼來源:JFXStopWatch.java

示例2: encodeAsHex

import java.time.ZonedDateTime; //導入方法依賴的package包/類
public static String encodeAsHex(LocalDateTime dateTime) {
    ZonedDateTime zonedDateTime = dateTime.atZone(ZoneOffset.UTC);

    byte[] bytes = new byte[5];
    bytes[0] = (byte) (zonedDateTime.getYear() - 2000);
    bytes[1] = (byte) (zonedDateTime.getMonthValue());
    bytes[2] = (byte) (zonedDateTime.getDayOfMonth());
    bytes[3] = (byte) (zonedDateTime.getHour());
    bytes[4] = (byte) (zonedDateTime.getMinute());

    return Hex.encodeHexString(bytes);
}
 
開發者ID:amvnetworks,項目名稱:amv-highmobility-cryptotool-wrapper,代碼行數:13,代碼來源:CryptotoolUtils.java

示例3: DatumtijdLiteral

import java.time.ZonedDateTime; //導入方法依賴的package包/類
/**
 * @param waarde een DateTime object
 */
public DatumtijdLiteral(final ZonedDateTime waarde) {
    super(waarde);
    uur = waarde.getHour();
    minuut = waarde.getMinute();
    seconde = waarde.getSecond();
}
 
開發者ID:MinBZK,項目名稱:OperatieBRP,代碼行數:10,代碼來源:DatumtijdLiteral.java

示例4: isEqual

import java.time.ZonedDateTime; //導入方法依賴的package包/類
private static boolean isEqual(LocalDateTime ldt, Timestamp ts) {
    ZonedDateTime zdt = ZonedDateTime.of(ldt, ZoneId.systemDefault());
    return zdt.getYear() == ts.getYear() + 1900 &&
           zdt.getMonthValue() == ts.getMonth() + 1 &&
           zdt.getDayOfMonth() == ts.getDate() &&
           zdt.getHour() == ts.getHours() &&
           zdt.getMinute() == ts.getMinutes() &&
           zdt.getSecond() == ts.getSeconds() &&
           zdt.getNano() == ts.getNanos();
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:11,代碼來源:JavatimeTest.java

示例5: createIndex

import java.time.ZonedDateTime; //導入方法依賴的package包/類
@SneakyThrows
public void createIndex(String sipId, int xmlVersion, String arclibXml) {
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware(true);
    Document xml;
    try {
        xml = factory.newDocumentBuilder().parse(new ByteArrayInputStream(arclibXml.getBytes()));
    } catch (ParserConfigurationException | SAXException | IOException e) {
        log.error("Error during parsing of XML document");
        throw e;
    }
    XPath xpath = getXpathWithNamespaceContext();
    ArclibXmlDocument solrArclibXmlDocument = new ArclibXmlDocument();

    SolrInputDocument doc = new SolrInputDocument();
    for (IndexFieldConfig conf : getFieldsConfig()) {
        NodeList fields = (NodeList) xpath.evaluate(conf.getXpath(), xml, XPathConstants.NODESET);

        for (int i = 0; i < fields.getLength(); i++) {
            try {
                switch (conf.getFieldType()) {
                    case DATETIME:
                        Calendar parsedDate = DatatypeConverter.parseDateTime(fields.item(i).getTextContent());
                        String parsedDateTimeString = DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(parsedDate.toInstant().atZone(ZoneId.systemDefault()));
                        solrArclibXmlDocument.addField(conf.getFieldName(), parsedDateTimeString);
                        break;
                    case DATE:
                        parsedDate = DatatypeConverter.parseDate(fields.item(i).getTextContent());
                        String parsedDateString = DateTimeFormatter.ISO_LOCAL_DATE.format(parsedDate.toInstant().atZone(ZoneId.systemDefault()));
                        solrArclibXmlDocument.addField(conf.getFieldName(), parsedDateString);
                        break;
                    case TIME:
                        ZonedDateTime time = DatatypeConverter.parseTime(fields.item(i).getTextContent()).toInstant().atZone(ZoneId.systemDefault());
                        long parsedTime = time.getHour() * 60 * 60 * 1000 + time.getMinute() * 60 * 1000 + time.getSecond() * 1000;
                        solrArclibXmlDocument.addField(conf.getFieldName(), parsedTime);
                        break;
                    default:
                        if (conf.isFullText()) {
                            solrArclibXmlDocument.addField(conf.getFieldName(), nodeToString(fields.item(i)));
                        } else {
                            solrArclibXmlDocument.addField(conf.getFieldName(), fields.item(i).getTextContent());
                        }
                }
            } catch (IllegalArgumentException | NullPointerException parsingEx) {
                String msg = String.format("Could not parse %s as %s", fields.item(i).getTextContent(), conf.getFieldType());
                log.error(msg);
                throw new BadArgument(msg);
            }
        }

    }
    solrArclibXmlDocument.setId(sipId + "_" + xmlVersion);
    solrArclibXmlDocument.setDocument(arclibXml);
    try {
        arclibXmlRepository.save(solrArclibXmlDocument);
    } catch (UncategorizedSolrException ex) {
        log.error(ex.getMessage());
        throw ex;
    }
}
 
開發者ID:LIBCAS,項目名稱:ARCLib,代碼行數:61,代碼來源:SolrStore.java

示例6: zonedDateTimeToDateValue

import java.time.ZonedDateTime; //導入方法依賴的package包/類
static DateValue zonedDateTimeToDateValue(ZonedDateTime dt) {
    return new DateTimeValueImpl(
            dt.getYear(), dt.getMonthValue(), dt.getDayOfMonth(),
            dt.getHour(), dt.getMinute(), dt.getSecond());
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:6,代碼來源:ZonedDateTimeIteratorFactory.java


注:本文中的java.time.ZonedDateTime.getMinute方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。