tags:

views:

90

answers:

1

Is there a way to get the time separator symbol ':' in Java? Is it a constant somewhere or a getter? Maybe there is something equivalent to the File.separator?

My time string is returned by DateFormat.getTimeInstance(DateFormat.SHORT, locale).format(date);

Is it safe to just use ':' in this case when later somebody wants to parse this string?

+2  A: 

I think it's safe to use ':'. It is hardcoded in SimpleDateFormat. For example:

if (text.charAt(++pos.index) != ':')
Bozho