Yes, it is valid (at compile time). And it is already in this format.
This though doesn't exclude the option that you have some issues at runtime.
So if any of MM and dd is 00, it throws this exception.
The exception message is kind of misleading IMHO
(I mean it would have been nicer if it was saying:
'invalid month' / 'invalid day of month' at runtime).
Note that if you specify this:
Timestamp ts = Timestamp.valueOf("0000-01-01 00:00:00.000000");
the parsed ts
value is actually
0001-01-01 00:00:00.000000
So to avoid surprises like this, I would make sure
I specify some valid yyyy mm and dd values as
it seems Timestamp is doing some conversions ,
internally when not all values (yyyy, mm, dd) are valid.