> This code outputs the date and the time that an event occurs, but how
> do I tell it to only output the time in MEDIUM format? I know this is
[quoted text clipped - 14 lines]
>
> Thank you :)
Your code produces...
Oct 9, 2006 9:50:28 PM
...on my system. That looks correct to me -- i.e., both date and time are
in MEDIUM format.
If I understand your question, you want to output the time only, like so...
9:50:28 PM
If that's what you want to do, then change this...
DateFormat formatter =
DateFormat.getDateTimeInstance(DateFormat.MEDIUM,
DateFormat.MEDIUM, Locale.US);
...to this...
DateFormat formatter =
DateFormat.getTimeInstance(DateFormat.MEDIUM, Locale.US);