Stretchwickster
Programmer
Hi,
I've specified a date format to be displayed (i.e. "HH:mm:ss" e.g. 14:47:32) and i want to be able to toggle this format with the use of one button to a 12 hr format (i.e "hh:mm:ss a" e.g 02:47:32 PM). I was wondering if it is possible to get the current format to know which format to change it to.
So:
if (formatter.? == "HH:mm:ss"
//what is the method to retrieve the current format?
{
formatter = new SimpleDateFormat("hh:mm:ss a"
}
else
{
formatter = new SimpleDateFormat("HH:mm:ss"
}
I've specified a date format to be displayed (i.e. "HH:mm:ss" e.g. 14:47:32) and i want to be able to toggle this format with the use of one button to a 12 hr format (i.e "hh:mm:ss a" e.g 02:47:32 PM). I was wondering if it is possible to get the current format to know which format to change it to.
So:
if (formatter.? == "HH:mm:ss"
//what is the method to retrieve the current format?
{
formatter = new SimpleDateFormat("hh:mm:ss a"
}
else
{
formatter = new SimpleDateFormat("HH:mm:ss"
}