Android Date String to Date Convert parseFileName(String timeStr)

Here you can find the source of parseFileName(String timeStr)

Description

Parse system time from string in the format "yyyyMMdd-HHmmss-SSS",

License

Apache License

Parameter

Parameter Description
timeStr Time string in the format "yyyyMMdd-HHmmss-SSS"

Declaration

public static long parseFileName(String timeStr) throws ParseException 

Method Source Code

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

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

import java.util.Locale;

public class Main {
    /**/*from  w w w . ja v a2s.  c om*/
     * Parse system time from string in the format "yyyyMMdd-HHmmss-SSS",
     * @param timeStr Time string in the format "yyyyMMdd-HHmmss-SSS"
     */
    public static long parseFileName(String timeStr) throws ParseException {
        return new SimpleDateFormat("yyyyMMdd-HHmmss-SSS", Locale.US)
                .parse(timeStr).getTime();
    }
}

Related

  1. getDateObj(String argsDate, String split)
  2. getDateOffset(String date, int offset)
  3. getDateTomorrow(String date)
  4. convertStandardDateTime(String time)
  5. removeTimeZone(String data)
  6. formatDate(String date)
  7. changeStringToDate(String fecha, String pattern)
  8. changeStringToDate1(String str)
  9. changeStringToDate2(String str)