/** * @return current UTC timestamp by yyyyMMddHHmmss mask */ public static String getUTCTimestamp() { return getUTCTimestamp( new Date() ); }
/** * 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 ); }
/** * @return current UTC timestamp by yyyyMMddHHmmss mask as a long int */ public static long getUTCTimestampAsLong() { return Long.parseLong( getUTCTimestamp( new Date() ) ); }
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; } } }
/** * @return current UTC timestamp by yyyyMMddHHmmss mask as a long int */ public static long getUTCTimestampAsMillis() { return Long.parseLong( getUTCTimestamp( new Date() ) ); }
/** * update versioning's lastUpdated timestamp to now * * @param target */ public static void updateTimestamp( Versioning target ) { target.setLastUpdated( TimeUtil.getUTCTimestamp() ); }
/** * update snapshot timestamp to now * * @param target */ public static void updateTimestamp( Snapshot target ) { target.setTimestamp( TimeUtil.getUTCTimestamp() ); }
private boolean updateSnapshot( Snapshot snapshot, Versioning vs ) { vs.setSnapshot( snapshot ); vs.setLastUpdated( TimeUtil.getUTCTimestamp() ); return true; }
String utc = TimeUtil.getUTCTimestamp(); sn.setTimestamp( utc );
_dumpFile = new File(_dumpFileName+"-"+TimeUtil.getUTCTimestamp()+"-"+System.currentTimeMillis()+".xml" ); _wr = new FileWriter(_dumpFile); _wr.write( "<tree>\n" ); _wr.write( "<scope>"+scope+"</scope>\n" ); _wr.write( "<timestamp>"+ TimeUtil.getUTCTimestamp() +"</timestamp>\n" );
vs.setLastUpdated( TimeUtil.getUTCTimestamp() );
vs.setLastUpdated( TimeUtil.getUTCTimestamp() );
tree.setTimestamp( TimeUtil.getUTCTimestamp() );