RE: serializing an NSTimestamp
RE: serializing an NSTimestamp
- Subject: RE: serializing an NSTimestamp
- From: "Pierre Bernard" <email@hidden>
- Date: Wed, 19 Nov 2003 15:46:09 +0100
- Thread-topic: serializing an NSTimestamp
Hi!
If you KNOW the String your are reading from your storage when deserializing represents an NSTimestamp, you could just store the internal representation of the timestamp: number of milliseconds since a reference date. Thus: String.toString(timestamp.getTime()).
If not, you are better off using common serialization methods: Serializable or NSCoding.
Pierre.
--
Got a hang for movies?
http://homepage.mac.com/I_love_my/movies.html
-----Original Message-----
From: email@hidden [mailto:email@hidden]
Sent: Tuesday, November 18, 2003 8:48 PM
To: email@hidden
Cc: email@hidden
Subject: Re: serializing an NSTimestamp
[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 email and any files transmitted with it are intended solely for
the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the sender
of this message. (email@hidden)
This email message has been checked for the presence of computer
viruses; however this protection does not ensure this message is
virus free.
Banque centrale du Luxembourg; Tel ++352-4774-1; http://www.bcl.lu
**********************************************************************
_______________________________________________
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.