当前位置: 首页>>代码示例>>Java>>正文


Java DateTime.withZone方法代码示例

本文整理汇总了Java中org.joda.time.DateTime.withZone方法的典型用法代码示例。如果您正苦于以下问题:Java DateTime.withZone方法的具体用法?Java DateTime.withZone怎么用?Java DateTime.withZone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.joda.time.DateTime的用法示例。


在下文中一共展示了DateTime.withZone方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: KubernetesInstance

import org.joda.time.DateTime; //导入方法依赖的package包/类
public KubernetesInstance(DateTime createdAt, String environment, String name, Map<String, String> properties, Long jobId, PodState state) {
    this.createdAt = createdAt.withZone(DateTimeZone.UTC);
    this.environment = environment;
    this.name = name;
    this.properties = properties;
    this.jobId = jobId;
    this.state = state;
}
 
开发者ID:gocd,项目名称:kubernetes-elastic-agents,代码行数:9,代码来源:KubernetesInstance.java

示例2: prepareForAssignment

import org.joda.time.DateTime; //导入方法依赖的package包/类
/**
 * A helper function for derived classes that checks to see if the old and new value are equal and if so releases
 * the cached dom. Derived classes are expected to use this thus: <code>
 *   this.foo = prepareForAssignment(this.foo, foo);
 *   </code>
 * 
 * This method will do a (null) safe compare of the objects and will also invalidate the DOM if appropriate
 * 
 * @param oldValue - current value
 * @param newValue - proposed new value
 * 
 * @return The value to assign to the saved Object.
 */
protected DateTime prepareForAssignment(DateTime oldValue, DateTime newValue) {
    DateTime utcValue = null;
    if (newValue != null) {
        utcValue = newValue.withZone(DateTimeZone.UTC);
    }

    return super.prepareForAssignment(oldValue, utcValue);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:AbstractSAMLObject.java

示例3: prepareForAssignment

import org.joda.time.DateTime; //导入方法依赖的package包/类
/**
 * A helper function for derived classes that checks to see if the old and new value are equal and if so releases
 * the cached dom. Derived classes are expected to use this thus: <code>
 *   this.foo = prepareForAssignment(this.foo, foo);
 *   </code>
 * 
 * This method will do a (null) safe compare of the objects and will also invalidate the DOM if appropriate
 * 
 * @param oldValue - current value
 * @param newValue - proposed new value
 * 
 * @return The value to assign to the saved Object
 */
protected DateTime prepareForAssignment(DateTime oldValue, DateTime newValue) {
    DateTime utcValue = null;
    if (newValue != null) {
        utcValue = newValue.withZone(DateTimeZone.UTC);
    }

    return super.prepareForAssignment(oldValue, utcValue);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:AbstractSignableSAMLObject.java

示例4: assertDateTimeEquals

import org.joda.time.DateTime; //导入方法依赖的package包/类
/**
 * This method compares two {@link DateTime} objects, ignoring their time zones.
 * 
 * @param actual
 *            the actual value
 * @param expected
 *            the expected value
 * @param msg
 *            a message to use
 */
public static void assertDateTimeEquals(DateTime actual, DateTime expected, String msg) {
    if (!actual.getZone().equals(expected.getZone())) {
        actual = actual.withZone(expected.getZone());
    }
    assertEquals(actual, expected, msg);
}
 
开发者ID:SolarNetwork,项目名称:killbill-easytax-plugin,代码行数:17,代码来源:EasyTaxTestUtils.java


注:本文中的org.joda.time.DateTime.withZone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。