Help, baffled by date handling - is everything deprecated?
Help, baffled by date handling - is everything deprecated?
- Subject: Help, baffled by date handling - is everything deprecated?
- From: Denis Stanton <email@hidden>
- Date: Fri, 13 Jun 2003 14:27:08 +1200
Can anyone point me to the correct function for what I hope are simple
date calculations. I've spent a lot of time reading through the
methods but nearly everything says it's deprecated and refers me to
something else. The API seems to be a bit messy.
I'm using WebObjects 5.2 with Java 1.3.1 of course.
I'm writing a program to record car hires. I need to record start date
and return dates, compare these with other dates and also calculate the
duration of a hire.
I thought this would be a simple matter but I've struck two problems.
It seems that all date objects have been deprecated in favour of
NSTimestamp. That's OK except that the timestamps define a point down
to the millisecond level and I only want to work in days. If I use a
method like 'after', as in "if ( startdate.after(someDate)" the
comparison will figure out the milliseconds so two events on the same
date will not have the same timestamp.
So the question here is, how do I tell NSTimestamp to ignore the units
smaller than 1 day - or should I be using a different object?
The second problem is with intervals. I can't find a method to
calculate the number of days between two dates.
I apologize for asking such basic questions. I really expected this to
be simple but I just can't find my way through the deprecations and
"see alsos" in the documentation.
Denis Stanton
_______________________________________________
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.