Here you can find the source of now()
public static java.util.Date now()
//package com.java2s; //License from project: Open Source License import java.time.LocalDateTime; import java.time.ZoneId; public class Main { public static java.util.Date now() { return java.sql.Date.from(LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant()); //return java.util.Date.from(new java.util.Date().toInstant()); }/* w w w. j av a 2s. c o m*/ }