Here you can find the source of now()
public synchronized static String now()
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Locale; import java.text.SimpleDateFormat; public class Main { public static final String DATE_FORMAT_NOW = "[dd MMMMM yyyy aaa hh:mm:ss.SSS z]"; public static final Locale DATE_LOCALE = Locale.UK; public synchronized static String now() { return new SimpleDateFormat(DATE_FORMAT_NOW, DATE_LOCALE).format(Calendar.getInstance().getTime()); }/*from www . j a va 2 s . co m*/ }