public static String euroUTCSystemDateString ( long timestamp ) { Calendar calendar = Calendar . getInstance ( ) ; calendar . setTimeInMillis ( timestamp ) ; calendar . setTimeZone ( UTC_TIME_ZONE ) ; int day = calendar . get ( Calendar . DAY_OF_MONTH ) ; int month = calendar . get ( Calendar . MONTH ) ; int year = calendar . get ( Calendar . YEAR ) ; int hour = calendar . get ( Calendar . HOUR_OF_DAY ) ; int minute = calendar . get ( Calendar . MINUTE ) ; int second = calendar . get ( Calendar . SECOND ) ; CharBuf buf = CharBuf . create ( 16 ) ; buf . add ( Str . zfill ( day , 2 ) ) . add ( ' ' ) ; buf . add ( Str . zfill ( month , 2 ) ) . add ( ' ' ) ; buf . add ( year ) . add ( ' ' ) ; buf . add ( Str . zfill ( hour , 2 ) ) . add ( ' ' ) ; buf . add ( Str . zfill ( minute , 2 ) ) . add ( ' ' ) ; buf . add ( Str . zfill ( second , 2 ) ) . add ( "_utc_euro" ) ; return buf . toString ( ) ; }
Useful for generated file names and generated work directories .