Java Integer to intToDateString(int i)

Here you can find the source of intToDateString(int i)

Description

int To Date String

License

Open Source License

Declaration

static String intToDateString(int i) 

Method Source Code

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

public class Main {
    static String intToDateString(int i) {
        String s = Integer.toString(i);
        if (i <= 9999) {
            return s;
        }/*from  w  ww.  java  2 s . c o  m*/
        if (s.length() < 8)
            return s.substring(0, 4);
        // return yyyy-mm-dd
        return s.substring(0, 4) + "-" + s.substring(4, 2) + "-"
                + s.substring(6, 2);
    }
}

Related

  1. intToBuffer(int i, byte[] ioBuffer)
  2. intToCodeString(int value)
  3. intToColour(int colour)
  4. intToCols(int i)
  5. intToColumnName(int column)
  6. intToDay(int d)
  7. intToDegree(int storedInt)
  8. intToDigits(int n)
  9. intToDouble(int coordinate)