Java Parse Date parseDate(String sDate, String sSourceFormat, String sDestinationFormat)

Here you can find the source of parseDate(String sDate, String sSourceFormat, String sDestinationFormat)

Description

parse Date

License

Open Source License

Declaration

public static String parseDate(String sDate, String sSourceFormat, String sDestinationFormat) 

Method Source Code

//package com.java2s;

public class Main {

    public static String parseDate(String sDate, String sSourceFormat, String sDestinationFormat) {
        String sRtn = "";
        try {//from w w  w . ja v a 2  s.  c o  m
            sRtn = new java.text.SimpleDateFormat(sDestinationFormat)
                    .format(new java.text.SimpleDateFormat(sSourceFormat).parse(sDate));
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return sRtn;
    }
}

Related

  1. parseDate(String sDate)
  2. parseDate(String sDate)
  3. parseDate(String sDate, Locale locale)
  4. parseDate(String sDate, SimpleDateFormat _dateFormat)
  5. parseDate(String sDate, String sFormat)
  6. parseDate(String sdate, String timeFormat, String timeZone)
  7. parseDate(String sDateTime, String sPattern)
  8. parseDate(String source, String format)
  9. parseDate(String src, String pattern)