Here you can find the source of fastDateTimeWriteHours(LocalDateTime localDateTime)
public static char[] fastDateTimeWriteHours(LocalDateTime localDateTime)
//package com.java2s; //License from project: Open Source License import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; public class Main { public static char[] fastDateTimeWriteHours(LocalDateTime localDateTime) { char[] c = new char[13]; LocalDate localDate = localDateTime.toLocalDate(); int y = localDate.getYear(); c[0] = (char) ('0' + y / 1000); c[1] = (char) ('0' + ((y % 1000) / 100)); c[2] = (char) ('0' + ((y % 100) / 10)); c[3] = (char) ('0' + (y % 10)); c[4] = (char) ('-'); int m = localDate.getMonthValue(); c[5] = (char) ('0' + (m / 10)); c[6] = (char) ('0' + (m % 10)); c[7] = (char) ('-'); int d = localDate.getDayOfMonth(); c[8] = (char) ('0' + (d / 10)); c[9] = (char) ('0' + (d % 10)); c[10] = (char) ('T'); LocalTime localTime = localDateTime.toLocalTime(); int h = localTime.getHour(); c[11] = (char) ('0' + (h / 10)); c[12] = (char) ('0' + (h % 10)); return c; }//from w w w . j a v a 2 s . c om }