posted 17 years ago
Try this:
I haven't compiled this, so there may be off-by-one errors, but you get the gist. The various parts can have different lengths, which might otherwise be a common source of errors. If you can be sure that days and months are always 2 digits, and the year 4 digits, then there is no need for the dashOne and dashTwo variables.
The proper way to do this is to use the java.text.SimpleDateFormat class, of course, but I'm sure someone else will post a snippet of code that shows that.
[ June 29, 2006: Message edited by: Ulf Dittmer ]