Android examples for java.util:Today
get Today in yyyy/MM/dd format
//package com.java2s; import android.annotation.SuppressLint; import java.text.SimpleDateFormat; import java.util.Date; public class Main { @SuppressLint("SimpleDateFormat") public static String getToday() { return new SimpleDateFormat("yyyy/MM/dd").format(new Date()); }/*from w w w . j a v a 2 s . c om*/ @SuppressLint("SimpleDateFormat") public static String getToday(String strFormat) { return new SimpleDateFormat(strFormat).format(new Date()); } }