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

x33g5p2x  于2022-01-23 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(201)

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

LocalTime.toString介绍

[英]Output the time in ISO8601 format (HH:mm:ss.SSSZZ).
[中]以ISO8601格式输出时间(HH:mm:ss.SSSZZ)。

代码示例

代码示例来源:origin: joda-time/joda-time

  1. /**
  2. * Output the time using the specified format pattern.
  3. *
  4. * @param pattern the pattern specification, null means use <code>toString</code>
  5. * @see org.joda.time.format.DateTimeFormat
  6. */
  7. public String toString(String pattern) {
  8. if (pattern == null) {
  9. return toString();
  10. }
  11. return DateTimeFormat.forPattern(pattern).print(this);
  12. }

代码示例来源:origin: JodaOrg/joda-time

  1. /**
  2. * Output the time using the specified format pattern.
  3. *
  4. * @param pattern the pattern specification, null means use <code>toString</code>
  5. * @see org.joda.time.format.DateTimeFormat
  6. */
  7. public String toString(String pattern) {
  8. if (pattern == null) {
  9. return toString();
  10. }
  11. return DateTimeFormat.forPattern(pattern).print(this);
  12. }

代码示例来源:origin: joda-time/joda-time

  1. /**
  2. * Output the time using the specified format pattern.
  3. *
  4. * @param pattern the pattern specification, null means use <code>toString</code>
  5. * @param locale Locale to use, null means default
  6. * @see org.joda.time.format.DateTimeFormat
  7. */
  8. public String toString(String pattern, Locale locale) throws IllegalArgumentException {
  9. if (pattern == null) {
  10. return toString();
  11. }
  12. return DateTimeFormat.forPattern(pattern).withLocale(locale).print(this);
  13. }

代码示例来源:origin: JodaOrg/joda-time

  1. /**
  2. * Output the time using the specified format pattern.
  3. *
  4. * @param pattern the pattern specification, null means use <code>toString</code>
  5. * @param locale Locale to use, null means default
  6. * @see org.joda.time.format.DateTimeFormat
  7. */
  8. public String toString(String pattern, Locale locale) throws IllegalArgumentException {
  9. if (pattern == null) {
  10. return toString();
  11. }
  12. return DateTimeFormat.forPattern(pattern).withLocale(locale).print(this);
  13. }

代码示例来源:origin: ebean-orm/ebean

  1. @Override
  2. public String formatValue(LocalTime v) {
  3. return v.toString();
  4. }

代码示例来源:origin: ebean-orm/ebean

  1. @Override
  2. public void jsonWrite(JsonGenerator writer, LocalTime value) throws IOException {
  3. writer.writeString(value.toString());
  4. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. /**
  2. * Output the time using the specified format pattern.
  3. *
  4. * @param pattern the pattern specification, null means use <code>toString</code>
  5. * @see org.joda.time.format.DateTimeFormat
  6. */
  7. public String toString(String pattern) {
  8. if (pattern == null) {
  9. return toString();
  10. }
  11. return DateTimeFormat.forPattern(pattern).print(this);
  12. }

代码示例来源:origin: apache/avro

  1. Assert.assertThat(withJoda.getT().toString(), is(withJsr310.getT().toString()));
  2. Assert.assertThat(withJoda.getTs().toString(), is(withJsr310.getTs().toString()));
  3. Assert.assertThat(withJoda.getDec(), comparesEqualTo(withJsr310.getDec()));

代码示例来源:origin: camunda/camunda-bpm-platform

  1. /**
  2. * Output the time using the specified format pattern.
  3. *
  4. * @param pattern the pattern specification, null means use <code>toString</code>
  5. * @param locale Locale to use, null means default
  6. * @see org.joda.time.format.DateTimeFormat
  7. */
  8. public String toString(String pattern, Locale locale) throws IllegalArgumentException {
  9. if (pattern == null) {
  10. return toString();
  11. }
  12. return DateTimeFormat.forPattern(pattern).withLocale(locale).print(this);
  13. }

代码示例来源:origin: Jasig/uPortal

  1. @Override
  2. public String toString() {
  3. return time.toString();
  4. }
  5. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

  1. /**
  2. * Output the time using the specified format pattern.
  3. *
  4. * @param pattern the pattern specification, null means use <code>toString</code>
  5. * @see org.joda.time.format.DateTimeFormat
  6. */
  7. public String toString(String pattern) {
  8. if (pattern == null) {
  9. return toString();
  10. }
  11. return DateTimeFormat.forPattern(pattern).print(this);
  12. }

代码示例来源:origin: redfish64/TinyTravelTracker

  1. /**
  2. * Output the time using the specified format pattern.
  3. *
  4. * @param pattern the pattern specification, null means use <code>toString</code>
  5. * @see org.joda.time.format.DateTimeFormat
  6. */
  7. public String toString(String pattern) {
  8. if (pattern == null) {
  9. return toString();
  10. }
  11. return DateTimeFormat.forPattern(pattern).print(this);
  12. }

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

  1. /**
  2. * Output the time using the specified format pattern.
  3. *
  4. * @param pattern the pattern specification, null means use <code>toString</code>
  5. * @see org.joda.time.format.DateTimeFormat
  6. */
  7. public String toString(String pattern) {
  8. if (pattern == null) {
  9. return toString();
  10. }
  11. return DateTimeFormat.forPattern(pattern).print(this);
  12. }

代码示例来源:origin: org.joda/com.springsource.org.joda.time

  1. /**
  2. * Output the time using the specified format pattern.
  3. *
  4. * @param pattern the pattern specification, null means use <code>toString</code>
  5. * @see org.joda.time.format.DateTimeFormat
  6. */
  7. public String toString(String pattern) {
  8. if (pattern == null) {
  9. return toString();
  10. }
  11. return DateTimeFormat.forPattern(pattern).print(this);
  12. }

代码示例来源:origin: io.virtdata/virtdata-lib-realer

  1. /**
  2. * Output the time using the specified format pattern.
  3. *
  4. * @param pattern the pattern specification, null means use <code>toString</code>
  5. * @see org.joda.time.format.DateTimeFormat
  6. */
  7. public String toString(String pattern) {
  8. if (pattern == null) {
  9. return toString();
  10. }
  11. return DateTimeFormat.forPattern(pattern).print(this);
  12. }

代码示例来源:origin: net.ftlines.wicket-fullcalendar/wicket-fullcalendar-core

  1. @Override
  2. public void serialize(LocalTime value, JsonGenerator jgen, SerializerProvider provider) throws IOException,
  3. JsonProcessingException {
  4. jgen.writeString(value.toString("h:mmaa"));
  5. }

代码示例来源:origin: com.github.workerframework/worker-testing-integration

  1. private void logWithTimestamp(final String debugInfo)
  2. {
  3. System.out.println(DateTime.now().toLocalTime().toString() + debugInfo);
  4. }
  5. }

代码示例来源:origin: com.synaptix/SynaptixWidget

  1. @Override
  2. public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos) {
  3. pos.setBeginIndex(0);
  4. pos.setEndIndex(0);
  5. toAppendTo.append(((LocalTime) obj).toString(dateTimeFormatter));
  6. return toAppendTo;
  7. }

代码示例来源:origin: JodaOrg/joda-time-hibernate

  1. public void nullSafeSet(PreparedStatement preparedStatement, Object value, int index) throws HibernateException, SQLException {
  2. if (value == null) {
  3. StandardBasicTypes.STRING.nullSafeSet(preparedStatement, null, index);
  4. } else {
  5. LocalTime lt = ((LocalTime) value);
  6. StandardBasicTypes.STRING.nullSafeSet(preparedStatement, lt.toString(), index);
  7. }
  8. }

代码示例来源:origin: dremio/dremio-oss

  1. @Test
  2. public void testToChar() throws Exception {
  3. String expectedResults[] = {(new LocalDate(2008, 2, 23)).toString("yyyy-MMM-dd"),
  4. (new LocalTime(12, 20, 30)).toString("HH mm ss"),
  5. (new LocalDateTime(2008, 2, 23, 12, 0, 0)).toString("yyyy MMM dd HH:mm:ss")};
  6. testCommon(expectedResults, "/functions/date/to_char.json", "/test_simple_date.json");
  7. }

相关文章