Java Format - Java SimpleDateFormat .get2DigitYearStart ()


SimpleDateFormat.get2DigitYearStart() has the following syntax.

public Date get2DigitYearStart()


In the following code shows how to use SimpleDateFormat.get2DigitYearStart() method.

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
/*w  w  w .ja  v a 2 s .  com*/
public class Main {
  public static void main(String[] args) throws Exception {
    SimpleDateFormat formatter = new SimpleDateFormat();
    String date = formatter.format(new Date());
    System.out.println("date = " + date);

The code above generates the following result.