Here you can find the source of parseFileName(String timeStr)
Parameter | Description |
---|---|
timeStr | Time string in the format "yyyyMMdd-HHmmss-SSS" |
public static long parseFileName(String timeStr) throws ParseException
//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(); } }