Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: serializing an NSTimestamp



On 18-Nov-03, at 2:38 PM, email@hidden wrote:

[demime could not interpret encoding binary - treating as plain text]
What's the right/easiest way to serialize an NSTimestamp to and from a String?


I've never done this before; there seem to be so many different ways, I'm
not sure the appropriate technique to use.


--Jonathan

From the documentation on NSTimestampFormatter:

To string:

 NSTimestampFormatter formatter=new NSTimestampFormatter("%m/%d/%y");
 String description=formatter.format(myNSTimestamp);

And back:

NSTimestampFormatter formatter=new NSTimestampFormatter("%m/%d/%y");
NSTimestamp myNSTimestamp=(NSTimestamp)formatter.parseObject(myTimestampString);

;david

--
David LeBer
Codebase Software Systems
_______________________________________________
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: 
 >serializing an NSTimestamp (From: email@hidden)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.