You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Terry McBride <tt...@yahoo.com> on 2001/11/09 01:19:37 UTC

Dates

Hello all,

I think I read somewhere that someone had made a cool
utility for having users enter dates from pulldowns
(might have been vel.macros w/ javascript).  Is this
true? does anyone know where I can find it?

Also, I have a situation where several date formats
are acceptable ( MM/dd/yyyy, MM/yyyy, yyyy ) but when
I set a Date field and insert 1950 into a MySQL
DATETIME field after using...

SimpleDateFormat simpleDateFormat = new
SimpleDateFormat("yyyy");
setBeginDate = simpleDateFormat.parse(dateString);

... I am left with 01/01/1950 in the MySQL database!
A peek at the MySQL manual says the valid range is
01/01/something to 12/31/somethingelse.

Should I abandon the date field and go with an integer
like 19500000 (and do some regex formatting) or can I
get the desired behavior some other way?

All recommendations are welcome.

Thanks for any help,
Terry McBride
King Paper's Project
Stanford University

__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Dates

Posted by Matthew Forder <fo...@ams.neth.seagate.com>.
Terry McBride wrote:

> Hello all,
>
> I think I read somewhere that someone had made a cool
> utility for having users enter dates from pulldowns
> (might have been vel.macros w/ javascript).  Is this
> true? does anyone know where I can find it?
>

org.apache.turbine.util.DateSelector

>
> Also, I have a situation where several date formats
> are acceptable ( MM/dd/yyyy, MM/yyyy, yyyy ) but when
> I set a Date field and insert 1950 into a MySQL
> DATETIME field after using...
>
> SimpleDateFormat simpleDateFormat = new
> SimpleDateFormat("yyyy");
> setBeginDate = simpleDateFormat.parse(dateString);
>
> ... I am left with 01/01/1950 in the MySQL database!
> A peek at the MySQL manual says the valid range is
> 01/01/something to 12/31/somethingelse.
>
> Should I abandon the date field and go with an integer
> like 19500000 (and do some regex formatting) or can I
> get the desired behavior some other way?
>
> All recommendations are welcome.

I'm afraid I don't have an answer for this question though!

Regards,

Matt

--
   ____  | Matthew J. Forder         | Data Center Supervisor
  / / () | Seagate Techology         | Tel:+31 20 316 7468
  \ \ \  | Koolhovenlaan 1           | Fax:+31 20 653 5537
 ()_/_/  | 1119 NB Schiphol-Rijk, NL | matthew.forder@seagate.com