Java SimpleDateFormat .get2DigitYearStart ()
Syntax
SimpleDateFormat.get2DigitYearStart() has the following syntax.
public Date get2DigitYearStart()
Example
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 .j a v a2s . c om
public class Main {
public static void main(String[] args) throws Exception {
SimpleDateFormat formatter = new SimpleDateFormat();
String date = formatter.format(new Date());
System.out.println(formatter.get2DigitYearStart());
System.out.println("date = " + date);
}
}
The code above generates the following result.