/** * convert timestamp to millis * * @param ts timestamp to convert. Presumed to be a long of form yyyyMMddHHmmss * @return millis, corresponding to the supplied TS * @throws ParseException is long does not follow the format */ public static long toMillis( long ts ) throws ParseException { return toMillis( "" + ts ); }
public static void main( String[] args ) throws Exception { if( args == null || args.length < 0 ) return; if( "-t".equals( args[0] ) ) { System.out.println( args[1]+" => " + new Date( toMillis( args[1] ) ) ) ; return; } } }