I hope you are all in good mood today!
because I need some help from you guys.
thats the problem:
I have (coming from an XML file) this String "2008-06-06 10:23:27.14" and this string: "2008-06-06" right?
so, I need to create Datatime and Data objects from this string.
I tryed to split the string, having 6 Strings, representing year, month, day, hour, minutes, seconds and nanos, and then use the constructor for timestamp using all this parameters.
beside, this constructor got deprecated, and I haven't got correct results (confused date and time).
The only Timestamp I found that has 6 parameters is the javax.sql.Timestamp, since you aren't using SQL I would guess that isn't the best tool to be using.
In fact, what you have is a Date (as in java.util.Date), and in one case you have Time values and in the other you don't.
My suggestion would be to use java.text.DateFormat to parse the Strings. If the format presented from the XML doesn't fit into one of pre-defined DateFormats, then you may need to use java.text.SimpleDateFormat to create your own format String.