Java String to Date strToDateWithFormat(String strDate, Format format)

Here you can find the source of strToDateWithFormat(String strDate, Format format)

Description

str To Date With Format

License

Apache License

Declaration

public static Date strToDateWithFormat(String strDate, Format format) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.text.Format;

import java.text.ParsePosition;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static Date strToDateWithFormat(String strDate, Format format) {
        SimpleDateFormat localFormat = (SimpleDateFormat) format;
        ParsePosition pos = new ParsePosition(0);
        Date strtodate = localFormat.parse(strDate, pos);
        return strtodate;
    }//  w  w  w. ja va  2 s.  com
}

Related

  1. strToDate(String time, String format)
  2. strToDate3(String i_StrDate)
  3. strToDateM6(String StrToDate)
  4. StrToDateSeco(String str)
  5. strToDatetime(String sStr)
  6. TimeStringToDate(String s)
  7. timeToDate(String time)
  8. toDate(DateFormat format, String value)
  9. toDate(final Long date, final String pattern)