V
Vera
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
easy but I just don't see how to do it
/** Method to Get Time of an Event */
public static String getTimeOfEvent()
{
GregorianCalendar calendar = new GregorianCalendar();
DateFormat formatter =
DateFormat.getDateTimeInstance(DateFormat.MEDIUM,
DateFormat.MEDIUM, Locale.US);
TimeZone timeZone = TimeZone.getTimeZone("CST");
formatter.setTimeZone(timeZone);
String outputTime = formatter.format(calendar.getTime());
return outputTime;
}
Thank you
do I tell it to only output the time in MEDIUM format? I know this is
easy but I just don't see how to do it
/** Method to Get Time of an Event */
public static String getTimeOfEvent()
{
GregorianCalendar calendar = new GregorianCalendar();
DateFormat formatter =
DateFormat.getDateTimeInstance(DateFormat.MEDIUM,
DateFormat.MEDIUM, Locale.US);
TimeZone timeZone = TimeZone.getTimeZone("CST");
formatter.setTimeZone(timeZone);
String outputTime = formatter.format(calendar.getTime());
return outputTime;
}
Thank you