org.joda.time.DateTime.toDateTimeISO()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(9.5k)|赞(0)|评价(0)|浏览(258)

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

DateTime.toDateTimeISO介绍

[英]Get this object as a DateTime using ISOChronology in the default zone, returning this if possible.
[中]在默认区域中使用等时法获取此对象作为日期时间,如果可能,返回this

代码示例

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

@Override
public String toString() {
 final String underlying =
   this.projectName + "." + this.flowName + " (" + this.projectId + ")"
     + " to be run at (starting) " + new DateTime(
     this.firstSchedTime).toDateTimeISO();
 if (this.period == null && this.cronExpression == null) {
  return underlying + " non-recurring";
 } else if (this.cronExpression != null) {
  return underlying + " with CronExpression {" + this.cronExpression + "}";
 } else {
  return underlying + " with precurring period of " + createPeriodString(this.period);
 }
}

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

private static int calculateBcdFromSubscription(final SubscriptionBase subscription, final InternalTenantContext internalTenantContext) {
    final DateTime date = subscription.getDateOfFirstRecurringNonZeroCharge();
    final int bcdLocal = internalTenantContext.toLocalDate(date).getDayOfMonth();
    log.debug("Calculated BCD: subscriptionId='{}', subscriptionStartDate='{}', bcd='{}'",
         subscription.getId(), date.toDateTimeISO(), bcdLocal);
    return bcdLocal;
  }
}

代码示例来源:origin: com.linkedin.azkaban/azkaban

public String toString() {
  return execId + " " + jobName + " to be checked at " + checkTime.toDateTimeISO();
}

代码示例来源:origin: zapr-oss/druidry

public String getOrigin() {
  return origin == null ? null : origin.toDateTimeISO().toString();
}

代码示例来源:origin: zapr-oss/druidry

@JsonValue
  private String getIntervalAsString() {
    return String.format(DRUID_INTERVAL_FORMAT, startTime.toDateTimeISO(), endTime.toDateTimeISO());
  }
}

代码示例来源:origin: zapr-oss/druidry

public String getOrigin() {
    return origin == null ? null : origin.toDateTimeISO().toString();
  }
}

代码示例来源:origin: killbilling/recurly-java-library

private String formatDate(final DateTime dateTime) {
  return dateTime.toDateTimeISO().toString();
}

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

DateTime dt = new DateTime(cal);
System.out.println(dt.toDateTimeISO());

代码示例来源:origin: com.linkedin.azkaban/azkaban-common

@Override
public String toString() {
 final String underlying =
   this.projectName + "." + this.flowName + " (" + this.projectId + ")"
     + " to be run at (starting) " + new DateTime(
     this.firstSchedTime).toDateTimeISO();
 if (this.period == null && this.cronExpression == null) {
  return underlying + " non-recurring";
 } else if (this.cronExpression != null) {
  return underlying + " with CronExpression {" + this.cronExpression + "}";
 } else {
  return underlying + " with precurring period of " + createPeriodString(this.period);
 }
}

代码示例来源:origin: com.linkedin.azkaban/azkaban

public String toString() {
  return projectName + "." + flowName + " (" + projectId + ")" + " to be run at (starting) " + 
      new DateTime(firstSchedTime).toDateTimeISO() + " with recurring period of " + (period == null ? "non-recurring" : createPeriodString(period));
}

代码示例来源:origin: com.linkedin.azkaban/azkaban

public String toString() {
  return projectName + "." + flowName + " (" + projectId + ")" + " to be run at (starting) " + 
      new DateTime(firstSchedTime).toDateTimeISO() + " with recurring period of " + (period == null ? "non-recurring" : createPeriodString(period));
}

代码示例来源:origin: org.dataconservancy.frontend/dcs-ui-archive-impl

/**
 * {@inheritDoc}
 * <em><strong>N.B.</strong></em>: this implementation does <em>not</em> set an identifier on the returned
 * {@code DcsEvent}.  It only will set the event type, and the current date time.
 *
 * @param eventType the returned event will carry this type
 * @return a new event, with the time set to the current date time, and event type set to {@code eventType}
 */
@Override
public DcsEvent newEvent(String eventType) {
  DcsEvent e = new DcsEvent();
  e.setDate(DateTime.now().toDateTimeISO().toString());
  e.setEventType(eventType);
  return e;
}

代码示例来源:origin: yahoo/fili

/**
   * Builds a JobRow with values for every field defined in {@link DefaultJobField}.
   *
   * @param request  The request that is triggering this job
   * @param requestContext  The context of the request triggering this job
   *
   * @return A JobRow with all the metadata for the job under construction
   */
  @Override
  public JobRow buildJobRow(UriInfo request, ContainerRequestContext requestContext) {
    Map<JobField, String> jobMetadata = new LinkedHashMap<>(DefaultJobField.values().length);

    String userId = userIdExtractor.apply(requestContext.getSecurityContext());

    jobMetadata.put(DefaultJobField.QUERY, request.getRequestUri().toString());

    jobMetadata.put(DefaultJobField.STATUS, DefaultJobStatus.PENDING.getName());

    String isoDateCreated = new DateTime(timestampGenerator.instant().toEpochMilli()).toDateTimeISO().toString();
    jobMetadata.put(DefaultJobField.DATE_CREATED, isoDateCreated);
    jobMetadata.put(DefaultJobField.DATE_UPDATED, isoDateCreated);

    jobMetadata.put(DefaultJobField.USER_ID, userId);
    jobMetadata.put(DefaultJobField.JOB_TICKET, idGenerator.apply(jobMetadata));

    return new JobRow(DefaultJobField.JOB_TICKET, jobMetadata);
  }
}

代码示例来源:origin: org.dataconservancy.ui/dcs-ui-archive-impl

/**
 * {@inheritDoc}
 * <em><strong>N.B.</strong></em>: this implementation does <em>not</em> set an identifier on the returned
 * {@code DcsEvent}.  It only will set the event type, and the current date time.
 *
 * @param eventType the returned event will carry this type
 * @return a new event, with the time set to the current date time, and event type set to {@code eventType}
 */
@Override
public DcsEvent newEvent(String eventType) {
  DcsEvent e = new DcsEvent();
  e.setDate(DateTime.now().toDateTimeISO().toString());
  e.setEventType(eventType);
  return e;
}

代码示例来源:origin: yahoo/fili

/**
   * Returns a copy of the specified JobRow with the specified field set to the specified value.
   * The returned JobRow also has the DATE_UPDATED field set to the start of the current day.
   *
   * @param row  The row to use as a prototype for the new row
   * @param field  The field to update
   * @param value  The value to assign to the field
   *
   * @return A JobRow that is identical to the specified row, except with the specified field set to the specified
   * value, and the DATE_UPDATED field set to the current instant according to timestampGenerator
   */
  private JobRow updateField(JobRow row, JobField field, String value) {
    return row
        .withFieldValue(field, value)
        .withFieldValue(
            DATE_UPDATED,
            new DateTime(timestampGenerator.instant().toEpochMilli()).toDateTimeISO().toString()
        );
  }
}

代码示例来源:origin: org.kill-bill.billing/killbill-util

private static int calculateBcdFromSubscription(final SubscriptionBase subscription, final InternalTenantContext internalTenantContext) {
    final DateTime date = subscription.getDateOfFirstRecurringNonZeroCharge();
    final int bcdLocal = internalTenantContext.toLocalDate(date).getDayOfMonth();
    log.debug("Calculated BCD: subscriptionId='{}', subscriptionStartDate='{}', bcd='{}'",
         subscription.getId(), date.toDateTimeISO(), bcdLocal);
    return bcdLocal;
  }
}

代码示例来源:origin: org.apereo.cas/cas-server-support-wsfederation

credential.setId(assertion.getID());
credential.setIssuer(assertion.getIssuer());
credential.setIssuedOn(ZonedDateTime.parse(assertion.getIssueInstant().toDateTimeISO().toString()));
val conditions = assertion.getConditions();
if (conditions != null) {
  credential.setNotBefore(ZonedDateTime.parse(conditions.getNotBefore().toDateTimeISO().toString()));
  credential.setNotOnOrAfter(ZonedDateTime.parse(conditions.getNotOnOrAfter().toDateTimeISO().toString()));
  if (!conditions.getAudienceRestrictionConditions().isEmpty()) {
    credential.setAudience(conditions.getAudienceRestrictionConditions().get(0).getAudiences().get(0).getUri());

代码示例来源:origin: com.ning.billing/killbill-junction

final int bcdLocal = date.toDateTime(account.getTimeZone()).getDayOfMonth();
log.info("Calculated BCD: subscription id {}, subscription start {}, timezone {}, bcd UTC {}, bcd local {}",
     subscription.getId(), date.toDateTimeISO(), account.getTimeZone(), bcdUTC, bcdLocal);

代码示例来源:origin: com.ning.billing/killbill-jaxrs

@Test(groups = "fast")
public void testJson() throws Exception {
  final String changeType = UUID.randomUUID().toString();
  final DateTime changeDate = clock.getUTCNow();
  final String changedBy = UUID.randomUUID().toString();
  final String reasonCode = UUID.randomUUID().toString();
  final String comments = UUID.randomUUID().toString();
  final String userToken = UUID.randomUUID().toString();
  final AuditLogJson auditLogJson = new AuditLogJson(changeType, changeDate, changedBy, reasonCode, comments, userToken);
  Assert.assertEquals(auditLogJson.getChangeType(), changeType);
  Assert.assertEquals(auditLogJson.getChangeDate(), changeDate);
  Assert.assertEquals(auditLogJson.getChangedBy(), changedBy);
  Assert.assertEquals(auditLogJson.getReasonCode(), reasonCode);
  Assert.assertEquals(auditLogJson.getComments(), comments);
  Assert.assertEquals(auditLogJson.getUserToken(), userToken);
  final String asJson = mapper.writeValueAsString(auditLogJson);
  Assert.assertEquals(asJson, "{\"changeType\":\"" + auditLogJson.getChangeType() + "\"," +
                "\"changeDate\":\"" + auditLogJson.getChangeDate().toDateTimeISO().toString() + "\"," +
                "\"changedBy\":\"" + auditLogJson.getChangedBy() + "\"," +
                "\"reasonCode\":\"" + auditLogJson.getReasonCode() + "\"," +
                "\"comments\":\"" + auditLogJson.getComments() + "\"," +
                "\"userToken\":\"" + auditLogJson.getUserToken() + "\"}");
  final AuditLogJson fromJson = mapper.readValue(asJson, AuditLogJson.class);
  Assert.assertEquals(fromJson, auditLogJson);
}

相关文章

DateTime类方法