Here you can find the source of getNow()
public static Date getNow()
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date getNow() { Date now = new Date(); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); try {//from ww w . j av a 2 s. com return dateFormat.parse(dateFormat.format(now)); } catch (ParseException e) { return null; } } }