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



If you want the string to be easily human readable NSTimestampFormatter is probably the way to go. But if you don't care about that why not just do something like this:

//to String
NSTimestamp outTimestamp = new NSTimestamp();
String tsString = Long.toString(outTimestamp.getTime());

//from string
NSTimestamp inTimestamp = new NSTimestamp(Long.decode(tsString).longValue());


--Albert

On Nov 18, 2003, at 2:47 PM, email@hidden wrote:

[demime could not interpret encoding binary - treating as plain text]
Hell, I suppose NSTimestampFormatter would be yet ANOTHER way of doing
this.

But in this case, I really do want to serialize it for storage in an
external store that only accepts Strings (the details do not matter).
I
guess NSTimestampFormatter might be one easy way of doing this. Is there
a better one?


--Jonathan

On Tue, 18 Nov 2003 11:29:45 -0800 Chuck Hill wrote:

Are you looking for NSTimestampFormatter?  See formatObject and
parseObject.

Chuck


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

--

Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net


Progress is the mother of all problems.
- G. K. Chesterton
_______________________________________________
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.


This e-mail (including any attachments) is covered by the Electronic
Communications Privacy Act, 18 USC. 2510-2521. It is confidential and
may be legally privileged. If you are not the intended recipient, you
are hereby notified that any retention, dissemination, distribution, or
copying of this communication is strictly prohibited. Please reply to
the sender that you have received the message in error, and then delete
it. Thank you. _______________________________________________
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: 
 >Re: 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.