Here you can find the source of formatDate(String values)
public static String formatDate(String values)
//package com.java2s; /************************************************************************************** * Copyright (C) 2012 Lisa park, Inc. All rights reserved. * http://www.lisa-park.com * * E-Mail: alexmy@lisa-park.com * * ---------------------------------------------------------------------------------- * * The software in this package is published under the terms of the GPL license * * a copy of which has been included with this distribution in the license.txt file. * * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt * **************************************************************************************/ public class Main { public static String formatDate(String values) { String[] dateParts = values.split("\\."); String newDate = dateParts[2] + "-" + dateParts[1] + "-" + dateParts[0]; return newDate; }//from w w w . j a v a 2 s .c o m }