• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTimestampFormatter problem (SOLVED)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTimestampFormatter problem (SOLVED)


  • Subject: Re: NSTimestampFormatter problem (SOLVED)
  • From: Alexandra Milton <email@hidden>
  • Date: Thu, 2 Sep 2004 08:52:04 +0200

Chuck, you are of course right. I don4t really know why I did not see that, I guess it is because I am doing this on my spare time. Sorry about posting such a simple issue. Now everything works as I intended.

Regards,

Alexandra
Stockholm, Sweden


2004-09-02 kl. 01.10 skrev Chuck Hill:

I can't see how that code you posted would even compile as myNSTimestamp is out of scope when referenced. Why not just use the format or formatter bindings on WOTextField? That is the usual way of doing this.

Chuck


On Sep 1, 2004, at 3:25 PM, Alexandra Milton wrote:

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.
_______________________________________________
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.


References: 
 >NSTimestampFormatter problem (From: Alexandra Milton <email@hidden>)
 >Re: NSTimestampFormatter problem (From: Chuck Hill <email@hidden>)

  • Prev by Date: problem with selectedObject of EOFormController in Java Client
  • Next by Date: RE: false sense of security?
  • Previous by thread: Re: NSTimestampFormatter problem
  • Next by thread: Changing Bindings on Sub-Components Via Hyperlinks?
  • Index(es):
    • Date
    • Thread