NSTimestampFormatter problem
NSTimestampFormatter problem
- Subject: NSTimestampFormatter problem
- From: Alexandra Milton <email@hidden>
- Date: Thu, 2 Sep 2004 00:25:50 +0200
I want to take a String from an input form and convert it to a
NSTimestamp before saving it to the database. I have tried the
following code:
if (hasDate) {
//takes the Date in stringformat an converts it into TIMESTAMP-format
NSTimestampFormatter formatter=new NSTimestampFormatter("%Y-%m-%d");
try {
NSTimestamp myNSTimestamp =
(NSTimestamp)formatter.parseObject(myTimestampString);
} catch (java.text.ParseException e) {
System.out.println("error parsing timeTaken date");
}
newPublication.setPublicationdate(myNSTimestamp);
}
But the result is "null" being written to the database. If I create a
new Timestamp it works just fine. Anybody knows why this is happening?
Regards,
Alexandra Milton
Stockholm, Sweden
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.