List of usage examples for org.joda.time.format ISODateTimeFormat dateTime
public static DateTimeFormatter dateTime()
From source file:com.github.autermann.yaml.construct.YamlNodeConstructor.java
License:Apache License
/** * Creates a new {@link Construct} for {@code !!timestamp}. * * @return the construct/* w w w. j av a 2 s .c o m*/ */ protected Construct timestampConstruct() { DateTimeFormatter encoding = ISODateTimeFormat.dateTime(); return new YamlTimeNodeConstruct(getNodeFactory(), this, encoding); }
From source file:com.github.autermann.yaml.nodes.YamlTextNode.java
License:Apache License
@Override public DateTime asDateTimeValue(DateTime defaultValue) { try {// w ww . j a v a 2s . c o m return ISODateTimeFormat.dateTime().parseDateTime(textValue()); } catch (IllegalArgumentException e) { return defaultValue; } }
From source file:com.github.autermann.yaml.nodes.YamlTimeNode.java
License:Apache License
@Override public String asTextValue(String defaultValue) { return ISODateTimeFormat.dateTime().print(value()); }
From source file:com.github.autermann.yaml.YamlNodeRepresenter.java
License:Apache License
/** * Creates a new representer using the supplied {@link DumperOptions}. * * @param options the dumper options/*w w w . j a va 2 s. co m*/ */ public YamlNodeRepresenter(DumperOptions options) { Objects.requireNonNull(options); this.timeEncoding = ISODateTimeFormat.dateTime(); this.binaryEncoding = BaseEncoding.base64().withSeparator(options.getLineBreak().getString(), options.getWidth()); YamlNodeRepresent represent = new YamlNodeRepresent(); register(YamlNullNode.class, represent); register(YamlBooleanNode.class, represent); register(YamlBinaryNode.class, represent); register(YamlTextNode.class, represent); register(YamlFloatNode.class, represent); register(YamlDoubleNode.class, represent); register(YamlBigDecimalNode.class, represent); register(YamlByteNode.class, represent); register(YamlShortNode.class, represent); register(YamlIntegerNode.class, represent); register(YamlLongNode.class, represent); register(YamlBigIntegerNode.class, represent); // has to be before YamlMapNode register(YamlOrderedMapNode.class, represent); register(YamlPairsNode.class, represent); register(YamlMapNode.class, represent); register(YamlSeqNode.class, represent); register(YamlSetNode.class, represent); register(YamlNode.class, represent); }
From source file:com.github.thorqin.toolkit.utility.StringUtils.java
public static String toISO8601(DateTime dateTime) { DateTimeFormatter formatter = ISODateTimeFormat.dateTime(); return dateTime.toDateTimeISO().toString(formatter); }
From source file:com.google.android.apps.paco.ESMSignalViewer.java
License:Open Source License
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); timeFormatter = ISODateTimeFormat.dateTime(); setContentView(R.layout.schedule_list); experimentProviderUtil = new ExperimentProviderUtil(this); fillData();/* w w w .j av a 2s .c o m*/ }
From source file:com.google.caliper.json.InstantTypeAdapter.java
License:Apache License
@Override public void write(JsonWriter out, Instant value) throws IOException { out.value(ISODateTimeFormat.dateTime().print(value)); }
From source file:com.google.caliper.json.InstantTypeAdapter.java
License:Apache License
@Override public Instant read(JsonReader in) throws IOException { return ISODateTimeFormat.dateTime().parseDateTime(in.nextString()).toInstant(); }
From source file:com.google.cloud.dataflow.sdk.testing.ResetDateTimeProvider.java
License:Apache License
public void setDateTimeFixed(String iso8601) { setDateTimeFixed(ISODateTimeFormat.dateTime().parseMillis(iso8601)); }
From source file:com.google.cloud.datastore.DateTime.java
License:Open Source License
@Override public String toString() { return ISODateTimeFormat.dateTime().print(timestampMillis()); }