Java LocalDate Calculate fastDateWrite(LocalDate localDate)

Here you can find the source of fastDateWrite(LocalDate localDate)

Description

fast Date Write

License

Open Source License

Declaration

public static char[] fastDateWrite(LocalDate localDate) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.time.LocalDate;

public class Main {
    public static char[] fastDateWrite(LocalDate localDate) {
        char[] c = new char[10];
        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));
        return c;
    }//from  w  w w  . ja  v a  2s  .  co  m
}

Related

  1. converterToLocalDate(final String date)
  2. convertLocalDateToDatabaseDateString(LocalDate localDate)
  3. dateToSystemLocalDate(Date d)
  4. daysAgo(LocalDate pastDate)
  5. doy(LocalDate date)
  6. fastDateWriteWeeks(LocalDate localDate)
  7. getAge(LocalDate birthday)
  8. getAge(LocalDate birthDay)
  9. getDate(ChronoLocalDate date)