Here you can find the source of subNow()
public static String subNow()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { static SimpleDateFormat dateFomaFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); public static String subNow() { return getNow().substring(0, 10); }/*from w ww. j a v a 2 s . co m*/ public static String getNow() { return dateFomaFormat.format(new Date()); } }