Android Date String to Date Convert changeStringToDate1(String str)

Here you can find the source of changeStringToDate1(String str)

Description

change String To Date

Declaration

public static String changeStringToDate1(String str) 

Method Source Code

//package com.java2s;

import java.text.ParseException;
import java.text.SimpleDateFormat;

public class Main {

    public static String changeStringToDate1(String str) {

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        java.util.Date date6 = null;
        try {/*from   w ww. jav a2 s . c  o  m*/
            date6 = sdf.parse(str);
            return date6.toString();
        } catch (ParseException e) {
            e.printStackTrace();
            return "";
        }
    }
}

Related

  1. convertStandardDateTime(String time)
  2. removeTimeZone(String data)
  3. parseFileName(String timeStr)
  4. formatDate(String date)
  5. changeStringToDate(String fecha, String pattern)
  6. changeStringToDate2(String str)
  7. changeStringToDate3(String str)
  8. convertDateStringToDate(String dateString)
  9. string2Date(String s, String s1)