Java Date String Format formatDate(String values)

Here you can find the source of formatDate(String values)

Description

format Date

License

Open Source License

Declaration

public static String formatDate(String values) 

Method Source Code

//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
}

Related

  1. formatDate(String date, int format)
  2. formatDate(String dateString, String delimiter)
  3. formatDate(String fieldName)
  4. FormatDate(String strDate, char DateSeparator)
  5. formatDate(String unformattedDate, String format)
  6. FormatDate6(String strDate)
  7. formatDateLog(String dateStr)
  8. formatDateString(String dateString)
  9. FormatDateString(String dateString)