* The old TYER field. Maybe <code>null</code>
* @return A time field containing given data.
*/
private static TimeId3Frame createTimeField(TextId3Frame tdat,
TextId3Frame time, TextId3Frame tyer) {
TimeId3Frame result = null;
Calendar calendar = new GregorianCalendar();
calendar.clear();
try {
if (tdat != null) {
if (tdat.getContent().length() == 4) {
calendar.set(Calendar.DAY_OF_MONTH, Integer.parseInt(tdat
.getContent().substring(0, 2)));
calendar.set(Calendar.MONTH, Integer.parseInt(tdat
.getContent().substring(2, 4)) - 1);
} else {
System.err
.println("Field TDAT ignroed, since it is not spec conform: \""
+ tdat.getContent() + "\"");
}
}
if (time != null) {
if (time.getContent().length() == 4) {
calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(time
.getContent().substring(0, 2)));
calendar.set(Calendar.MINUTE, Integer.parseInt(time
.getContent().substring(2, 4)));
} else {
System.err
.println("Field TIME ignroed, since it is not spec conform: \""
+ time.getContent() + "\"");
}
}
if (tyer != null) {
if (tyer.getContent().length() == 4) {
calendar.set(Calendar.YEAR, Integer.parseInt(tyer
.getContent()));
} else {
System.err
.println("Field TYER ignroed, since it is not spec conform: \""
+ tyer.getContent() + "\"");
}
}
result = new TimeId3Frame(RECORD_DAT, calendar);
} catch (NumberFormatException e) {
System.err.println("Numberformatexception occured "
+ "in timestamp interpretation, date is set to zero.");
e.printStackTrace();
calendar.clear();