• 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: serializing an NSTimestamp
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: serializing an NSTimestamp


  • Subject: Re: serializing an NSTimestamp
  • From: "Albert Jagnow" <email@hidden>
  • Date: Tue, 18 Nov 2003 15:37:08 -0600
  • Priority: normal

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)

  • Prev by Date: RE: Multiple Servers and Shared Editing Contexts
  • Next by Date: Re: [Solved - kinda] Re: WO 5.2.2 - Getting an app to launch - java.lang.NoClassDefFoundError
  • Previous by thread: Re: serializing an NSTimestamp
  • Next by thread: RE: serializing an NSTimestamp
  • Index(es):
    • Date
    • Thread