Calendar time formatting
Calendar time formatting
- Subject: Calendar time formatting
- From: Simon Wright <email@hidden>
- Date: Sat, 29 Sep 2001 11:06:18 -0400
Friends:
I'm using this...
myTime.get(Calendar.HOUR_OF_DAY)+":"+myTime.get(Calendar.MINUTE)+":"+myTime.
get(Calendar.SECOND);
to make a string that represents the time. When the hour or minute or
second is less than 10, I'm getting...
1:2:3
When I'd like to get...
01:02:03
How can I achieve this? Or is there some Calendar call that I'm
overlooking that will give me the string preassembled?
Same question applies to dates, although there's probably some mechanism I
should use that applies the proper internationalization to the date string.
TIA.
Simon