> -----Original Message----- > From: Jorge Salido [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 29, 2004 1:01 PM > To: Struts Users Mailing List > Subject: Re: [OT] Storing Birth Date > >
<snip> stuff I agree with </snip> > > Other than that, how you store the date is your call. I usually prefer > handling dates as numeric values, and using a YYYYMMDD format, so they > can easily be sorted. But that's just me. If you rely on any tools for > persistence, use what will suit them. If you depend on the database > for date operations, use whatever date format the db provides > natively. In any case, it depends more in which one will prove to be > more comfortable for you in the long run. My experience differs from Jorge. A generic date should do well, and still give you all the date functions. The only problem with storing dates as a number is doing date arithmetic ( say sending an email to all people whose birthday is 5 days away) and things like that. It's not a tremendous burden to overcome, it's just every time I run across dates stored that way, I always end up writing way more code then I need to. > > BTW, on the client side, I highly recommend you to try this calendar > picker script (javascript) > http://dynarch.com:1979/mishoo/calendar.epl On that note, remember that one purpose of MVC is to seperate how your data looks to the user, and how it is stored. The action class is in charge of converting from the presentation layer to the persistance/business layers. So you can use any represnetation makes sense for your users. > > Jorge > > > On Sat, 26 Jun 2004 19:24:23 +0800, Eddie Yan > <[EMAIL PROTECTED]> wrote: > > > Anyone know what is the best practices to store a person > > date of birth ? How should we design our detail object, JSP > and database > > in such way we don't have a messy approached to populate the day, > > month and year in Action class to be able to display in JSP > during UPDATE > > process. > > > > Currently, I have a JSP with combo box for day, month and year. > > Using mySQL db, I set the dateOfBirth column to TIMESTAMP. > > (Some told me to use DATE for this column). > > > > Obviously TIMESTAMP have the limitation since date of birth before > > Jan 1 1970 will be stored as 00000000000. Know any workaround > > to this one ? > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]