• 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: Advice on datetime manipulation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Advice on datetime manipulation


  • Subject: Re: Advice on datetime manipulation
  • From: Dev WO <email@hidden>
  • Date: Mon, 24 Oct 2005 20:14:10 +0200

Hi Ken:)
You're asking why? because it's too simple:) :)
This is a really good point and it simplify everything.

Thanks Ken

Xavier



Why not just get the current year and subtract the year of birth?

On Oct 24, 2005, at 1:37 PM, Dev WO wrote:


Thanks Sacha,
you are right, "age" is calculated based on "the first new year following the date of birth".
I'll dig into the datetime methods to see if there's already something I could use...






On Oct 24, 2005, at 10:24 AM, Dev WO wrote:




Hi list,
usually I do something stupid and then ask for your help;) so this time I though it would be wise to ask before doing something "not good":)
So I have to handle poneys and horses (yes it's funny), and they have something very specific:
These "items" aren't 1 year old when they have 12 month!
In fact they get 1 year old when they cross their first "new year", so if it has born on december 29th it will be 1 year old only 3 days after...


And I have to manage "categories" depending of their "age".

So my question is regarding the clever way to handle that.

I've got their date of birth in database. I don't think I can handle something like their "official age" directly in the EOModel (but I may be wrong), so I think I have to handle that directly in code.

Quite some items are already in the database, but maybe it would be good to handle this when they insert the item like having another attribute "official date of birth" which will be set to the previous new year and so doing the "regular" calculation on this attribute and not on the "real" date of birth.

Or handling all this when generating the list only.

Any advice on this is greatly appreciated, or pointer to specific method that would be of help:)




Sounds like the "age" is a calculated field, based on date of birth. Your best bet is probably to create a method "age" on your EO that returns the age, calculated from the date of birth.


HTH,


sacha

--
Sacha Michel Mallais             Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65             AIM: smallais
Bottom posting is your friend:
http://www.river.com/users/share/etiquette/








_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40anderhome.com


This email sent to email@hidden






_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Advice on datetime manipulation (From: Dev WO <email@hidden>)
 >Re: Advice on datetime manipulation (From: Sacha Michel Mallais <email@hidden>)
 >Re: Advice on datetime manipulation (From: Dev WO <email@hidden>)
 >Re: Advice on datetime manipulation (From: Ken Anderson <email@hidden>)

  • Prev by Date: Re: Advice on datetime manipulation
  • Next by Date: Re: Advice on datetime manipulation
  • Previous by thread: Re: Advice on datetime manipulation
  • Next by thread: Re: Advice on datetime manipulation
  • Index(es):
    • Date
    • Thread