Try using the SimpleDateFormat(). You can do just about any date configuration
with this. If you need an example let me know.

Michael Nash wrote:

> Have a look at the java.text.DateFormat in the API doc - it might have what
> you need.
>
> -----Original Message-----
> From: Jeetandra Mahtani [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 26, 1999 11:30 AM
> To: [EMAIL PROTECTED]
> Subject: Getting date in yyyymmdd
>
> Hello,
> I have a hidden Date field in a form. Before the
> servlet can add a record to the database, I need to
> set this date field to the current date but I can't
> seem to get the year in the format of yyyy. Also, I
> need the Date and the month to always be of two
> characters. Like today it is set as 99526 but I need
> it as 19990526.
> I've been using
> Date c1crdt = new Date();
> String curdate =
> c1crdt.getYear()+c1crdt.getMonth()+c1crdt.getYear();
> Any suggestions/ideas?
> Thanks,
> J
>
> _________________________________________________________
> DO YOU YAHOO!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to