Here you can find the source of getCurrentDate()
public static int[] getCurrentDate()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static int[] getCurrentDate() { int[] dateBundle = new int[3]; String[] temp = getDataTime("yyyy-MM-dd").split("-"); for (int i = 0; i < 3; i++) { try { dateBundle[i] = Integer.parseInt(temp[i]); } catch (Exception e) { dateBundle[i] = 0;/*from w w w. ja va2s .c o m*/ } } return dateBundle; } public static String getDataTime(String format) { SimpleDateFormat df = new SimpleDateFormat(format); return df.format(new Date()); } }