Java Utililty Methods Date UTC Format

List of utility methods to do Date UTC Format

Description

The list of methods to do Date UTC Format are organized into topic(s).

Method

SimpleDateFormatgetUTCFormat()
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;
DateparseCcsdsUtcFormat(String timeString)
parse Ccsds Utc Format
if (timeString.length() == 20) {
    return CCSDS_UTC_FORMAT.parse(timeString);
return CCSDS_UTC_MILLIS_FORMAT.parse(timeString);
StringtoUTCDateFormat(Date date)
Returns UTC String representation of a date.
return dateToString(date, UTC_DATE_Z_FORMAT);
StringUTCToLocalTime(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);
...