Java Time Parse getTimeWithStr(String source, String pattern)

Here you can find the source of getTimeWithStr(String source, String pattern)

Description

get Time With Str

License

Apache License

Declaration

public static long getTimeWithStr(String source, String pattern) throws Exception 

Method Source Code


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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static long getTimeWithStr(String source, String pattern) throws Exception {
        return new SimpleDateFormat(pattern).parse(source).getTime();
    }//from   w w w . j  ava  2  s  . c o m

    public static Date parse(String DateStr) throws Exception {
        return new SimpleDateFormat("yyyyMMdd").parse(DateStr);
    }
}

Related

  1. getTimeFromGermanLocale(String timeString)
  2. getTimeFromJsToJava(String date)
  3. getTimeFromString(String time)
  4. getTimeList(String start, String end, int pitch)
  5. getTimeStr(String date1, String date2)
  6. getTimeX(String dateStr)
  7. isDateTime(String dateTime)
  8. isDateTime(String dateTime, String pattern)
  9. isDatetimeParsable(String value)