Here you can find the source of getCurrent()
public static Date getCurrent()
//package com.java2s; /**/*w ww . ja v a 2 s . c o m*/ * Copyright (c)2010-2011 Enterprise Website Content Management System(EWCMS), All rights reserved. * EWCMS PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * http://www.ewcms.com */ import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { private static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd"; public static Date getCurrent() { return getCurrent(DEFAULT_DATE_FORMAT); } public static Date getCurrent(String format) { SimpleDateFormat simple = new SimpleDateFormat(format); Date current = new Date(Calendar.getInstance().getTime().getTime()); try { current = simple.parse(simple.format(current)); } catch (Exception e) { } return current; } }