Here you can find the source of getYear_Second2()
public static String getYear_Second2()
//package com.java2s; import java.text.DateFormat; import java.text.SimpleDateFormat; public class Main { public static String getYear_Second2() { java.util.Date date1 = new java.util.Date(); DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String timeStr2 = df.format(date1); return timeStr2; }/*from w ww. j a v a 2 s. c om*/ }