// Set the timezone to UTC.
date[3] = 0;
date[4] = 0;
} else {
// Invalid date format.
throw new SystemException(ErrorCode.FORG0001);
}
}
// Final touches on seconds and timezone.
date[2] = (long) (date[2] * Math.pow(10, decimalPlace));
if (!positiveTimezone && date[3] != DateTime.TIMEZONE_HOUR_NULL) {
date[3] *= -1;
}
if (!positiveTimezone && date[4] != DateTime.TIMEZONE_MINUTE_NULL) {
date[4] *= -1;
}
if (date[0] == 24) {
date[0] = 0;
}
// Double check for a valid time
if (!DateTime.valid(1972, 12, 31, date[0], date[1], date[2], date[3], date[4])) {
throw new SystemException(ErrorCode.FORG0001);
}
dOut.write(ValueTag.XS_TIME_TAG);
dOut.write((byte) date[0]);
dOut.write((byte) date[1]);