Re: Java date questions
Re: Java date questions
- Subject: Re: Java date questions
- From: email@hidden
- Date: Thu, 30 Oct 2003 11:10:09 CDT
- Priority: 3 (Normal)
[demime could not interpret encoding binary - treating as plain text]
timestampByAddingGregorianUnits is deprecated though. Oh wait, bizarrely
it's not deprecated. I could have sworn it was deprecated, and we were
supposed to use GregorianCalendar for any and all timestamp manipulation.
Weird.
The reason I'm investigating this in the first place is because I have
some date/time manipulating code which occasionally is behaving
strangely. I can't reproduce it, I just see it in my logs, causing
exceptions. [One example is it sometimes somehow decides that an
NSTimestamp has a year of '27235'. Um.] I looked at the code, and
thought, gee, it's probably becuase I'm using
timestampByAddingGregorianUnits and the NSTimestamp constructor, which
are deprecated, and it would probably work better if I converted to using
GregorianCalendar for manipulation. But now I see they aren't
deprecated.... so it remains a mystery why my code is misbehaving. Hmm.
--Jonathan
On Wed, 29 Oct 2003 19:32:36 -0800 Sam Barnum wrote:
> file:///Developer/Documentation/WebObjects/Reference/API/com/
> webobjects/foundation/
> NSTimestamp.html#timestampByAddingGregorianUnits(int, int, int, in
> t, int, int)
>
> timestampByAddingGregorianUnits() is a handy function for just that.
>
> On Wednesday, October 29, 2003, at 04:57 PM,
> email@hidden wrote:
>
> > [demime could not interpret encoding binary - treating as plain text]
> > This isn't a WO question, it's more of a Java question, but I can't
> > seem
> > to figure it out anywhere.
> >
> > I have an NSTimestamp. I want to subtract seven days from it. If it's
> > September 10, I want to end up with September 3. If it's September 1,
> > I
> > want to end up with October 25.
> >
> > I probably am gonna want to convert the NSTimestamp to a
> > GregorianCalendar first. Fair enough. But I can't figure out what
> > methods to call on the GregorianCalendar to do this date subtraction.
> >
> > --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.
_______________________________________________
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.