Here you can find the source of nowInBasicFormat()
public static String nowInBasicFormat()
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final ThreadLocal<SimpleDateFormat> BASIC = new ThreadLocal<SimpleDateFormat>() { @Override/* w w w . j ava 2 s .c om*/ protected SimpleDateFormat initialValue() { return new SimpleDateFormat("yyyy.MM.dd HH:mm:ss.SSS"); } }; public static String nowInBasicFormat() { return BASIC.get().format(new Date()); } }