B
B. Schad
Hi,
to format a certain time (say 14:15) what would you have to do? I found
the following way:
Calendar cal = Calendar.getInstance();
cal.set (Calendar.HOUR_OF_DAY, 14);
cal.set (Calendar.MINUTE, 15);
Date date = cal.getTime();
DateFormat df = DateFormat.getTimeInstance();
StringBuffer msg = new StringBuffer();
msg.append (df.format (date));
The problem seemed to be that it is not possible to directly format a
Calendar time. Do I really have to create a (somewhat incomplete) Date
from the Calender time first?
Kind regards,
B. Schad
to format a certain time (say 14:15) what would you have to do? I found
the following way:
Calendar cal = Calendar.getInstance();
cal.set (Calendar.HOUR_OF_DAY, 14);
cal.set (Calendar.MINUTE, 15);
Date date = cal.getTime();
DateFormat df = DateFormat.getTimeInstance();
StringBuffer msg = new StringBuffer();
msg.append (df.format (date));
The problem seemed to be that it is not possible to directly format a
Calendar time. Do I really have to create a (somewhat incomplete) Date
from the Calender time first?
Kind regards,
B. Schad