Here you can find the source of toMediaWikiString(Timestamp timestamp)
public static String toMediaWikiString(Timestamp timestamp)
//package com.java2s; /******************************************************************************* * Copyright (c) 2010 Torsten Zesch./*from ww w .j av a 2s .c o m*/ * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser Public License v3 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/lgpl.html * * Contributors: * Torsten Zesch - initial API and implementation ******************************************************************************/ import java.sql.Timestamp; public class Main { public static String toMediaWikiString(Timestamp timestamp) { String original = timestamp.toString(); StringBuffer result = new StringBuffer(); result.append(original.substring(0, 4));//year result.append(original.substring(5, 7));//month result.append(original.substring(8, 10));//date result.append(original.substring(11, 13));//hour result.append(original.substring(14, 16));//minute result.append(original.substring(17, 19));//second return result.toString(); } }