Here you can find the source of now()
private static String now()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static SimpleDateFormat fmt = new SimpleDateFormat( "dd/MM/yyyy hh:mm:ss"); /**//from w ww.j a v a 2 s.c o m * Retorna a Data do sistema ignorando a hora minuto segundo. */ private static String now() { java.util.Date dt = new Date(); String ds = fmt.format(new Date()); return ds; } }