MCPcopy Create free account
hub / github.com/MenoData/Time4J / toString

Method toString

base/src/main/java/net/time4j/ZonalDateTime.java:611–654  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

609 * @see #print(TemporalFormatter)
610 */
611 @Override
612 public String toString() {
613
614 StringBuilder sb = new StringBuilder(40);
615 sb.append(this.timestamp.getCalendarDate());
616 sb.append('T');
617 int hour = this.timestamp.getHour();
618 if (hour < 10) {
619 sb.append('0');
620 }
621 sb.append(hour);
622 sb.append(':');
623 int minute = this.timestamp.getMinute();
624 if (minute < 10) {
625 sb.append('0');
626 }
627 sb.append(minute);
628 sb.append(':');
629 if (this.isLeapSecond()) {
630 sb.append("60");
631 } else {
632 int second = this.timestamp.getSecond();
633 if (second < 10) {
634 sb.append('0');
635 }
636 sb.append(second);
637 }
638 int n = this.timestamp.getNanosecond();
639 if (n != 0) {
640 PlainTime.printNanos(sb, n);
641 }
642 sb.append(this.getOffset());
643 TZID tzid = this.getTimezone();
644 boolean offset = (tzid instanceof ZonalOffset);
645
646 if (!offset) {
647 sb.append('[');
648 sb.append(tzid.canonical());
649 sb.append(']');
650 }
651
652 return sb.toString();
653
654 }
655
656 @Override
657 public ZonedDateTime toTemporalAccessor() {

Callers 1

toStringOutputMethod · 0.95

Calls 11

isLeapSecondMethod · 0.95
printNanosMethod · 0.95
getOffsetMethod · 0.95
getTimezoneMethod · 0.95
canonicalMethod · 0.95
getHourMethod · 0.65
getMinuteMethod · 0.65
getSecondMethod · 0.65
getNanosecondMethod · 0.65
toStringMethod · 0.65
getCalendarDateMethod · 0.45

Tested by 1

toStringOutputMethod · 0.76