• 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
Help, baffled by date handling - is everything deprecated?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Help, baffled by date handling - is everything deprecated?
      • From: Marek Wawrzyczny <email@hidden>
  • Prev by Date: URL Parsing
  • Next by Date: Re: Help, baffled by date handling - is everything deprecated?
  • Previous by thread: Re: URL Parsing
  • Next by thread: Re: Help, baffled by date handling - is everything deprecated?
  • Index(es):
    • Date
    • Thread