List of utility methods to do Date UTC Format
SimpleDateFormat | getUTCFormat() Returns instance of a SimpleDateFormat where the format has been set to yyyy-DDDThh:mm:ss.SSS, GMT SimpleDateFormat format = new SimpleDateFormat("yyyy'-'DDD'T'HH:mm:ss.SSS"); format.setLenient(false); return format; |
Date | parseCcsdsUtcFormat(String timeString) parse Ccsds Utc Format if (timeString.length() == 20) { return CCSDS_UTC_FORMAT.parse(timeString); return CCSDS_UTC_MILLIS_FORMAT.parse(timeString); |
String | toUTCDateFormat(Date date) Returns UTC String representation of a date. return dateToString(date, UTC_DATE_Z_FORMAT);
|
String | UTCToLocalTime(String UTCFormat, Logger logger) Set a string date from UTC format (yyyyMMdd'T'HHmmss'Z') into a format dd/MM/yyyy HH:mm:ss according to default local timezone. String actualTime = UTCFormat; try { SimpleDateFormat formatter = new SimpleDateFormat(PATTERN_UTC); formatter.setLenient(false); formatter.setTimeZone(TIMEZONE_UTC); Date date = formatter.parse(UTCFormat); Calendar rightNow = Calendar.getInstance(); formatter.setCalendar(rightNow); ... |