Here you can find the source of getFormat(String format)
protected static SimpleDateFormat getFormat(String format)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; public class Main { /** yyyy-MM-dd hh:mm:ss */ public static final String DATE_FORMAT2 = "yyyy-MM-dd HH:mm:ss"; protected static SimpleDateFormat getFormat(String format) { if (format == null || "".equals(format)) { format = DATE_FORMAT2;//from www. ja v a 2s . c o m } return new SimpleDateFormat(format); } }