Java examples for java.util:Year
get current year ,month ,day, according to your ask that you given request then return your needs times
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**/* ww w . jav a 2 s . c o m*/ * * get current year ,month ,day, according to your ask that you given * request then return your needs times * */ public static String[] GetDatefromSystem() { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Date curDate = new Date(System.currentTimeMillis()); String date = sdf.format(curDate); String[] text = date.split("-"); return text; } }