I wrote my own date handling class, and it will do what you are looking for:
Essentially, to provide a picture for the users you pass in the locale to
SaneDate.getDateFormat().
To parse the date,
try {
new SaneDate(request.getParameter(parm),lc);
} catch (InvalidDateException ide) {
}
: George Sexton [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 08, 2005 9:39 AM
To: 'Tomcat Users List'
Subject: RE: Date parsing
I wrote my own date handling class, and it will do what you are looking
for:
Essentially, to provide a picture for the users you pass in the locale
://www.mhsoftware.com/
Voice: 303 438 9585
-Original Message-
From: Charles P. Killmer [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 08, 2005 10:16 AM
To: Tomcat Users List
Subject: RE: Date parsing
This has a bunch of useful methods in it. Thank you.
However what I am looking for is some
You could do regular expression field validation. That is, client-side
(javascript), build a regular expression object that finds a match for many
formats and run the test function on the input string. If true, a match was
found, and hence a legal date. The downside is that if you have many
Thank you Jann.
Expected the constants to be initialised on correct time values, but ok, that's
stupid. After all, they are constants... Should have known that. Sorry.
Nico
Yes! When you say cal.HOUR_OF_DAY (etc.) you're accessing a CONSTANT in the
calendar object.
What you want to use is the SimpleDateFormat class. It will do all that you
need!
Like this:
SimpleDateFormat df = new SimpleDateFormat("dd-MM- hh:mm:ss");
then ...
retVal = df.format(dt);
Try the following:
String dateString = "03/02/2001";
java.text.SimpleDateFormat format = new
java.text.SimpleDateFormat("dd/MM/"); // assuming DMY
try {
Date d = format.parse(dateString);
} catch( java.text.ParseException ex ) {}
- Original Message -
From:
Use the MessageFormat object in java.text.MessageFormat included in the JDK.
Peter Thorsager
- Original Message -
From: "Carlos" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, February 02, 2001 15:23
Subject: date
in jsp how i get the date for print in web in the format
in jsp how i get the date for print in web in the format XX-XX-XX?
Works just like any other java class:
java.util.GregorianCalendar cal= new GregorianCalendar();
java.text.SimpleDateFormat format = new SimpleDateFormat("mm-dd-yy");
String s = format(cal.getTime());
---
Michael Wentzel
On Fri, 2 Feb 2001, Carlos wrote:
in jsp how i get the date for print in web in the format XX-XX-XX?
java.util.Calendar - but *please* - this is not a Tomcat or even JSP
issue.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
nks
Carlos
- Original Message -
From: "Michael Wentzel" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, February 02, 2001 2:54 PM
Subject: RE: date
in jsp how i get the date for print in web in the format XX-XX-XX?
Works just like any other java class:
java.util.GregorianC
in a jsp page i have put the next but doesn't run: Why?
%
java.util.GregorianCalendar cal= new GregorianCalendar();
java.text.SimpleDateFormat format = new SimpleDateFormat("mm-dd-yy");
String s = format(cal.getTime());
%
htmlbody
%
out.println(s);
%
/body/html
Give a little
SimpleDateFormat("mm-dd-yy");
String s = format(cal.getTime());
%
htmlbody
%
out.println(s);
%
/body/html
-Original Message-
From: Carlos [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 02, 2001 10:11 AM
To: [EMAIL PROTECTED]
Subject: Re: date
in a jsp page i have pu
Replying to my own post...;P
I was just talking to Randy(Layman) about this and we
figured that more than likely your problem is the mask value
that I gave you in the code snippet is incorrect. In your
API docs check out java.text.SimpleDateFormat for the correct
masks(javadocs can be your best
mailto:[EMAIL PROTECTED]]
Sent: Friday, February 02, 2001 8:04 AM
To: '[EMAIL PROTECTED]'
Subject: RE: date
Replying to my own post...;P
I was just talking to Randy(Layman) about this and we
figured that more than likely your problem is the mask value
that I gave you in the code snippet is incorrec
l.java:498)
at java.lang.Thread.run(Thread.java:484)
- Original Message -
From: "CPC Livelink Admin" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, February 02, 2001 4:36 PM
Subject: RE: date
What is the error message? It could be that if you did not import
java.util.* and java.text.*
1 11:23 AM
To: [EMAIL PROTECTED]
Subject: Re: date
if i put that in a jsp page appears the next error: how can i get the date?
thanks
Error: 500
Localizacion: /fecha.jsp
Error interno del servlet:
org.apache.jasper.JasperException: No se puede compilar la clase para
JSP/opt/jakarta/work/www.opticagaldaka
om: Carlos [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 02, 2001 11:23 AM
To: [EMAIL PROTECTED]
Subject: Re: date
if i put that in a jsp page appears the next error: how can i get the date?
thanks
Error: 500
Localizacion: /fecha.jsp
Error interno del servlet:
org.apache.jasper.JasperException: N
18 matches
Mail list logo