I want to parse Date from StringBuilder without conversion to String.

SimpleDataFormat.parse(String) implementation use only CharSequence methods, length() and charAt(), but defined as defined.

Is there simple (standard) way to do this, except copying the whole SimpleDateFormat class, for example?

有帮助吗?

解决方案

Seems there is DateTimeFormatter.parse(CharSequence) method in Java 8's java.time package. Overlooked it.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top