Here you can find the source of formatDate(String formats, Calendar date)
@Deprecated public static String formatDate(String formats, Calendar date)
//package com.java2s; /*//from w ww .ja v a2 s. c om * Copyright (C) 2006-2016 Talend Inc. - www.talend.com * * This source code is available under agreement available at * %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt * * You should have received a copy of the agreement along with this program; if not, write to Talend SA 9 rue Pages * 92150 Suresnes, France */ import java.util.Calendar; public class Main { public static String DATE_FORMAT_PREFIX = "%t"; @Deprecated public static String formatDate(String formats, Calendar date) { String formatValue = formats; if (formats.startsWith(DATE_FORMAT_PREFIX)) { while (true) { if (!formatValue.contains(DATE_FORMAT_PREFIX)) { break; } String format = formatValue.substring(formatValue.indexOf(DATE_FORMAT_PREFIX), formatValue.indexOf(DATE_FORMAT_PREFIX) + 3); String valueStr = String.format(java.util.Locale.ENGLISH, format, date); formatValue = formatValue.replace(format, valueStr); } } else { formatValue = String.format(java.util.Locale.ENGLISH, formats, date); } return formatValue; } }